3 ms·
I've always considered code to be "clever" when its using something in a way it is rarely used, and usually specifically with something very common like an arit
by _heimdall 2y ago
I've always considered code to be "clever" when its using something in a way it is rarely used, and usually specifically with something very common like an arithmetic operator.
I've seen some really clever code using arithmetic operators to flip variables in ways that look like magic at first. I've also seen, and used myself, a few similar kinds of tricks in JavaScript especially when working with booleans.
I never really considered code "clever" when its just unreadable or incomprehensible. IMO that's just bad code.