in reply to keywords versus variables
It makes great sense that a program with fewer values to consider would have fewer bugs. Are you talking about two different programs where one has fewer variables by its nature, or are you talking about removing variables consciously from existing programs?
The complicated data structures you mention I've always found handy for decreasing the overall number of variables, BTW. Instead of having a lot of related but disconnected variables that need to be passed around, I can have one data structure that describes a bunch of details about the current topic. I can then delete, alter, pass, and return the one data structure.
Let's look at a typical first-year programming class assignment. I think most of us have done a very simple payroll program. Just the function call illustrates the point:
vs.figure_pay ( $name, $emp_id, $rate, $hours, $gets_overtime, $hours_without_ot, $ot_multi );
So all other things being equal, I'd say you're definitely on to something. I think perhaps it's balanced against other issues, though, and shouldn't necessarily be a singular goal.figure_pay ( \%employee );
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: keywords versus variables
by rvosa (Curate) on Aug 30, 2007 at 18:00 UTC | |
by mr_mischief (Monsignor) on Aug 30, 2007 at 18:17 UTC | |
Re^2: keywords versus variables
by GrandFather (Saint) on Aug 30, 2007 at 21:36 UTC | |
by blahblahblah (Priest) on Sep 01, 2007 at 01:08 UTC | |
by girarde (Hermit) on Sep 06, 2007 at 13:36 UTC |