In addition to what everyone else has said about using pre or post increment in more complex statements and assignments, there *was* also a further reason for using pre increment over post increment in certain circumstances.
When incrementing STL (or other similar) iterators in a loop then pre increment was preferred as it was significantly faster. With more modern compilers this is no longer the case, but you’ll still see a lot of older code, or code written by older programmers, using pre increment for this reason and habit. I myself still always use pre increment even in other languages like C# because I’ve had it drilled into me from > 20 years of programming.
See: https://eklitzke.org/stl-iterators-and-performance-revisited
Latest Answers