- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I shouldn't have been frist with this stupid comment.
Admin
Pfft. Many years ago, I ran across a comment that said more or less, "This code doesn't work and I don't know why."
Happily for me, I wrote neither the code nor the comment.
Admin
A very common comment.
Admin
Whaaat? No Easy Reader Version?!? Am I supposed to read ALL THAT TEXT this time? Come on!
Admin
Or sometimes "This code does work and I don't know why.", because from the looks of it couldn't have possibly ever done so.
Admin
Obey this sign!
Admin
Favourite I ever saw: "Do not rewrite this to work in the obviously better way, because then [other function] breaks and we don't know why."
Admin
// To do - fix this
Not so bad, bit useless. Now work with someone (in the days before source control) who doesn't remove the tag after fixing it.
Admin
Friend of mine used to listen to Black Sabbath while coding, and whenever there was some particularly noteworthy lyric he'd add it as a code comment. If there weren't any noteworthy lyrics, the code would end up uncommented.
Admin
// This code sometimes randomly stops working an we don't know why
I once worked at a project where we did know it stopped working due to some straightforward to fix threading issue, but were not allowed to fix it... It caused us to disregard a whole slew of other issues as 'Oh, its the threading problem again' (it wasn't).
Admin
As per 'To do' comment, yes, at least put some 'tag' in the comment so someone with time to refactor/fix can find things to look at. I tend to use 'XXX' because the editor I use will highlight that.
Admin
Reminds me of my still favorite error message:
Obvious Mode Error
Succinct and to the point.
Admin
Admin
Actual comment:
| TODO: WTF
Admin
As I said about Thursday's article...
Admin
no comment
Admin
Adding to the list of "my favourite" comments: "This is where the miracle needs to happen" I didn't write that code. And it did need a miracle. Preferably the Sodom and Gomorrah kind.
Admin
As a senior developer there is a golden rule I teach the new guys.
If you read a piece of code and you have a 'oooh, THAT is what it does' moment. Document it!
Admin
I also never use Right-Join only left, gives me one less thing to worry/think about.
Admin
I'm happy to report that there are no comments in our code base containing 'WTF' :-)
Admin
So So So So true. Right Joins totally suck.
Admin
My favorite comment of all time (paraphrased):
// [PersonA] I have no idea what this code does, but it's been here since [8 years previous] and I'm not touching it. // [PersonB, 7 years later] I also have no idea what this does. I'm not touching it either.
Admin
"//TODO: Fix this later"
Finding this in code that has been in production for years isn't nice. It's even worse when you find out that you are responsible for the code and the comment.