From Efficiency versus intent by Andrew Koenig :
First, it is far from obvious that
++i
is more efficient thani++
, at least where integer variables are concerned.
And :
So the question one should be asking is not which of these two operations is faster, it is which of these two operations expresses more accurately what you are trying to accomplish. I submit that if you are not using the value of the expression, there is never a reason to use
i++
instead of++i
, because there is never a reason to copy the value of a variable, increment the variable, and then throw the copy away.
So, if the resulting value is not used, I would use ++i
. But not because it is more efficient: because it correctly states my intent.