David Newton wrote:... or use an inline xor swap, or...
According to me, swapping variables with the
XOR trick is only a way to show off how clever you are
It looks obscure, makes your code less readable, and does not have any real advantages (for example, it's not "faster" in general because you don't need a temp variable). Don't do the XOR trick when writing real software (unless there is a really, really special reason, for example when you're programming a microcontroller in assembly language, and you really need to spare a register).