in reply to Re^4: I hate nested loops
in thread I hate nested loops
I prefer the nested loops, because that makes it easier to change the value that is assigned.
That is only a benefit if the initialisation value is likely to change to a per item initialisation value. But it isn't. Indeed, it is very, very rare that is required at all. And much rarer still that an algorithm will suddenly change from requiring bulk initialisation to per-item initialisation.
And the effort involved in the change on those extremely rare occasions, is so trivial, that expending any effort -- even thought -- to trying to optimise it, is the very definition of premature optimisation; the woe in O'Woe; the pointless in contrary counter-argument.
It's like carrying a gas mask with you everywhere you go. One day it might save your life -- but the odds are stacked so high against it, nobody does.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: I hate nested loops
by JavaFan (Canon) on Aug 11, 2011 at 08:07 UTC | |
by BrowserUk (Patriarch) on Aug 11, 2011 at 08:34 UTC |