News for hackers. Stuff that matters.
Re:What's wrong with this code, really? by IgorPartola on Friday September 16, 2011 @12:55PM (#3005241)
Exactly. For example in JavaScript doing a something.length would result in re-counting the number of elements, while doing the loop in this style would efficiently store the count in a variable that is fast to access and manipulate. I suppose if you want to be a real optimization junky you'd also use --i instead of i--.
Re:What's wrong with this code, really? by dkersten on Friday September 16, 2011 @01:53PM (#3005503)
I suppose if you want to be a real optimization junky you'd also use --i instead of i--.

Ten years ago, sure, but nowadays I trust the compiler to do this for me ;-)