Ran across this post with an example of the worst toString method this developer has ever seen, let’s take a look:
public String toString() {if (this != null)return "**** implement me";return "i am null";}
This is really for the programmers in the group… the amount of stupid involved in writing the above snippet of code is like marrying your cousin, then cheating on her with your sister, who then has a kid and then you decide to name it “Wheels” cause you think it sounds cool… you would also live in a double-wide.
You have to appreciate the check for null on this in a non-static method which is impossible, then you get the added benefit of returning “i am null” incase the impossible situation occurs… you know, cause a null object would be running so awesome anyway.
You can always tell when you end up on a team with one of these guys… they are the ones that have the “goose-in-the-headlights” look during the technical review meetings and say things like “Oh… um I just wanted to make sure the codes were safe from hacking” when asked why they wrote that… which will usually cause the know-it-all in the group to throw a clot.





















Leave a Reply