|
|
|
|
|
by sverrirs
3522 days ago
|
|
I don't know why I'm even replying, this will get so much hate here, oh well... 1. Just because things aren't done "the way you would do them" doesn't mean they're "bad" or "wrong". 2. If you're not on a solo project, I've found writing correct but less "clever" code to help shorten ramp-up time for new devs and be more beneficial to future maintainability of the code-base and system. TL;DR; Swapping values by XOR'ing may look elite and clever but hurts you in the long run. |
|
Further, I would consider Linus's one-liner 'indirect=...' to be 'clever' code.
If I were reviewing it, I would want it expanded into more obvious code as it requires too much cognitive overhead to parse.