hamster_nz:
Unless you are really speaking about a wide range of languages, consider specifying which one the question is about. They really are different.
I prefer pre-increment for clarity while merely incrementing, as it does literally what I am wishing to do: it increments. Post-increment usually means “increment, but also retain the previous value and return it”, which — if used the way you have shown — goes into “increment, but also retain the previous value and return it, but actually ignore it.” I see it as unneccessary complexity to think about that additional step.
They are also not identical even in that particular code, at least not in every language. For example in C++ an overloaded postincrement operator may store the value, which is not really needed. The compiler may remove in many cases, but this is not guaranteed.
Doctorandus_P:
In which language? In C this is undefined behaviour, because you are left-shifting a signed variable beyond its range.(1) Note that using uint8_t is irrelevant here: it only tells compilers to perform some additional operations.(2)
____
(1) C99, C11: 6.5.7§4.
(2) Which will be optimized out in any sane compiler nowadays, but this is not guaranteed.