Brenden Bickner
Nov 7 · 1 min read

While I agree that this article is more or less useless, you are incorrect about his pseudo-code being wrong for post increment. What you posted would be the equivalent of pre increment but with wasted code.

Think of this:

If we use your code as a function to replace i++, yes “i” would increment (assuming passed by reference) but you’d also be returning the incremented “i” instead of what it was before the increment.

Post increment means use original value of “i” then increment.

Pre increment means increment value of “i” then use value.