The Daily WTF
2008-06-02 | Filed Under Amusing, Software development |
Sweet Frith on the hills, how did I manage to overlook The Daily WTF for so long? This website is a gold mine chock full of hysterically funny, spine-chilling software development occurrences from real-life projects, all nicely wrapped in deeply sarcastic commentary.
For example, consider the following method:
public bool getIsNull (object obj) {
return (obj==null);
}
Short. Simple. Tells the story.
However, while preparing the release of their product, management brought in a highly-paid consultant to refactor a load of code; during his efforts, he chanced upon the above method (and many like it), and decided to dump the old-fashioned == operator in favour of the much more enterprise-y .Equals method:
public bool getIsNull (object obj) {
return obj.Equals(null);
}
I realise this is deeply, almost ludicrously nerdy, but that change had me weeping with laughter for a good ten minutes. Fellow coders will understand why.
Post Linx
Permalink | Trackback |
|
Print This Page |
Comments
Leave a Reply