Friday, January 21, 2005

Geeky Friday: The Daily WTF

I've had the occasion in my career to see some really nasty code. I hope I haven't written much. If you enjoy the good feeling that comes with laughing at other people's bad code, you'll like The Daily WTF (or add the RSS feed to your aggregator).

Here's a beautiful example:

    boolean exceptionFlag = true;
    try {
     initializeResources();
     compareAggregates();
     exceptionFlag = false;
    } catch(Exception e) {
     if(exceptionFlag) e.printStackTrace();
    }

    if(exceptionFlag) throw new Exception("An Error has occured");
(Sorry non-geeks, it'd take too long to explain the humor in this)

No comments: