On Fri, Dec 20, 2013 at 7:42 AM, Gregory Ewing <greg.ew...@canterbury.ac.nz> wrote: > A piece of code such as > > for (i = 0; i < numThings; i++) > total[i] += things[i]; > > is NOT improved by rewriting it as > > for (theLoopIndex = 0; theLoopIndex < numThings; theLoopIndex++) > total[theLoopIndex] += things[theLoopIndex]; > > Quite the reverse, IMO.
Wholeheartedly agreed. The only improvement I would make would be to declare i in the if block (valid in C++ and some of the more recent C standards), to emphasize the locality of the variable. ChrisA -- https://mail.python.org/mailman/listinfo/python-list