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:
$name, $emp_id, $rate, $hours,
$gets_overtime, $hours_without_ot, $ot_multi
figure_pay ( \%employee );
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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||