DATE: <$BlogItemDate$> 6/21/2007 07:48:00 PM ----- TITLE:Good code BODY:
I came across a piece of Java code so confusing today that I almost submitted it to the Daily WTF. It looked something like this (Variable names are changed to protect innocent trade-marks):
if(fileLoaded ? fileIsTypeA : file.typeA)
    refresh();
else
    enqueueRefresh();
I'm still not entirely sure what it does. My mind was mangled by the logic. I posted it to an internal newsgroup for the amusement of others, pondering who would have allowed such an abomination into the code-base. Luckily CVS had the answer: It was me. I have no recollection of it, and have no idea what I was thinking or intending at the time. I don't even know if it works. Luckier still that I didn't submit it to the Daily WTF.
--------