Best Code I’ve Seen All Day

For real.

  public Request  handleRequest ( Request aRequest ) throws InternalError {
        // Never called.
        if ( 1 == 0 )
            throw new InternalError();
        return null;
    }

Yep.

You can leave a response, or trackback from your own site.

Facebook comments:

5 Responses to “Best Code I’ve Seen All Day”

  1. Alex Miller says:

    Hey, at least it doesn’t say “if ( 1 = 0 )”. :)

  2. David Stamm says:

    Did you add the “never called” comment? Or was that another stroke of genius from the original developer?

  3. James Carr says:

    It was another stroke of genius from the original developer :)

  4. hey James, just curious… in production code or test code?

  5. James Carr says:

    Michael, I wish I could say that it was found in test code…

    of course, I am slowly learning that sometimes people don’t define “test code” as something that you find in UnitTests :)

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!