Serious question, was ++i just a typo or is it a java thing that I don't know?
In this context
On some processors (and on many RISC architecture) ++i might be executed in one or two less cycles than i++. So performance oriented programmers will always use ++i or --i version when they are equivalent to the i++ and i-- version.
a[i++] = 0; is not equivalent to a[++i] = 0;
but as increment/decrement of a for() loop it does not make a difference
Not sure it will always make a difference, especially in Java, but when I see programmers's code using --i in a for() loop I suspect them to be also experience Assembler programmers so I trust a bit more their code .
This post has been edited by pbl: 24 May 2011 - 02:26 AM