RSS

Worst toString method ever

Sat, Aug 19, 2006    (No Ratings, Click to rate this article!) Loading ... Loading ...

Humor & Fun, Technology


Erik threw up a post with the worst toString() method he’s ever run into… I have to admit, this is pretty incredible:

public String toString() {
if (this != null)
return “**** implement me”;
return “i am null”;
}

That is like set-yourself-on-fire-and-do-society-a-favor terrible. If this != null on a non-static method? Nice. Maybe the original developer should throw in some code to double check that the VM is running to?

If you program like this, please stop :(

Share This on Your Favorite Social Network:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Fark
  • Furl
  • Propeller
  • Reddit
  • Technorati
  • StumbleUpon
  • description
  • MisterWong
  • TwitThis
  • Slashdot
  • SphereIt
, ,

This post was written by:

Riyad Kalla - who has written 1637 posts on The “Break it Down” Blog.

"Ultimately I just want to provide a resource that folks find useful."

Leave a Reply