Good code
June 21st, 2007
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.
Entry Filed under: Uncategorized

Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed