

Boolean operation "trick" - SandB0x
http://stackoverflow.com/questions/3687397/boolean-operation-trick

======
KeithMajhor
A classmate of mine wrote something similar in C++ a while ago:

if ( Foo( ) == true ) { return false; } else { return true; }

The comparison to true is what really had me laughing.

------
jonsmock
I would laugh, but I know I've written similar clunky code while thinking
about the more complicated problem at hand (especially if in a rush).

Also, this is a neat example to show how novices/beginners learn how to
program. They don't think about conditionals operating on booleans, the result
of an expression like (1 == 2). And, they overall just seem to treat booleans
differently. Seems silly once you've internalized it, but I'm sure we all make
this realization while we're learning.

