Classic WTF: When Comments go Wild

It's a holiday in the US, so while we're gathering with friends and family, reminiscing about old times, let's look back on the far off year of 2004, with this classic WTF. Original -- Remy

Bil Simser comments on comments ...

I'm always pleased when I see developers commenting code. It means there's something there that should be commented so the next guy will know WTF whoever wrote it was thinking. However much like any FOX special, there are times when "Comments Gone Wild". I present some production code that contains some more, err, useful comments that I've found.

// Returns: Position of the divider
// Summary: Call this method to get the position of the divider.
int GetDividerPos();

Hmmm. Glad that was cleared up.

// Summary: Call this method to refresh items in the list.
void Refresh();

Again. Good to know.

// Summary: Call this method to remove all items in the list.
void RemoveAllItems();

Whew. For a minute there I thought we would have to spend some serious debugging
time hunting down this method.

And my personal favorite...

/* this next part does something cool; don't even try to understand it*/
while(i_love_lucy_is_on_tv)
{
   xqtc_fn();
}

i_love_lucy_is_on_tv turned out to be a boolean variable set to false. Go figure.

Heh. And on an unrelated note, I've just given the good o'le two-week notice to my employer. I'll miss 'em ... they were the inspiration for starting this blog, and provided a good many of posts. I trust Jakeypoo will update us on some of their new developments, and pray I'll have nothing to share with you from my new employer.

[Advertisement] Otter - Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!

This post originally appeared on The Daily WTF.

Leave a Reply

Your email address will not be published.