A few years back, Randy A took a contract as a maintenance developer on a wretched abomination of an application. Like those who've stared into the heart of the Great Codethulhu, Randy's retinas are forever burned with code from the system. One line that continues to haunt his dreams is as clear as the day he first encountered it...
return (test == true)? ( (test == false)? false : true) : ((test == false) ? false : true);
When he first stumbled across it in a treacherous debugging session, he resorted to a truth table to figure out what exactly that line did...
return test;
It might not have been as bad, except for the fact that, minutes later, he stumbled across a slightly altered version of it again. And, minutes later, another one. All told, the same perverted logic was repeated nine different times in that module.
He pleaded with his lead to simply replace the code with "return test". But, like so many others who feared tempting the beast, Randy's boss replied "I'm not sure why it's in there, and it's probably best we keep it in there."