Nice article! This is thanks to C and has always been a gotcha in every language that implemented it.
Although, because of the semantic difference and the confusion it can cause, you will very rarely see auto-increment used inside other expressions in typical industry code - it would never pass a code review. You will see the postfix variant from time to time, but it's typically just run as a single statement on it's own line for the the side-effect (+ 1).
We’re a place for programmers to stay up-to-date, learn new skills, and share ideas.
We’ll never post without your permission.