Real Source Code Comments, Volume 1

Anyone who has ever spelunked the source code of a large legacy platform has discovered many a skeleton and usually some hilarious source code comments as well. Here are a few I have found from both categories:

// the lack of error handing
// across this plaform has to stop.

Apparently so does the lack of spell-checking

// This is bad kids, don't do this.
// Seriously don't.

Worked about as well as, “Do as I say, not as I do.”

// This is crazy stuff you have to
// do because SQL_DEV_02 is haunted.

They might have been better off calling GhostBusters.

// TODO: fix this hell, this is not
// fun to manage.

According to Dante, there were seven circles of Hell. This was just the first.

This is from a README.txt file, so it is not truly a source code comment. But is noteworthy nonetheless:

Turn off unit tests
so this project will build


Back to real source code comments:

// Other stuff that goes in stuff.

It must have been some pretty important stuff. Seriously, why take the time to type that? Did they get paid by the number of comments? Or had I, having inherited the codebase, simply lost my sense of humor by that point?

// No idea what this would be for us
// or what it's for but I think you
// need one.

Turned out the author was right on both points: It was needed and he definitely proved he did not know what it was.

// I do not understand any of this.

This author was right, too.

And the winner is…

Here is some classic client-side Javascript known to be executing in tens of thousands of web browsers:

// TODO: this probably needs to be more secure... 
portal.cookie.add("username", username); 
portal.cookie.add("password", password);


I love how the winner simultaneously annotates a coding horror as well as the confession that the author didn’t care enough to avoid it.