Avoid Postfix Increment Operator
- by muntoo
I've read that I should avoid the postfix increment operator because of performance reasons (in certain cases).
But doesn't this affect code readability? In my opinion:
for(int i = 0; i < 42; i++);
/* i will never equal 42! */
Looks better than:
for(int i = 0; i < 42; ++i);
/* i will never equal 42! */
But this is probably just out of habit. Admittedly, I haven't seen many use ++i.
Is the performance that bad to sacrifice readability, in this case? Or am I just blind, and ++i is more readable than i++?