Following the last post about the usage of TODO style comments, I asked the developers here at RADVISION to send me stories about inappropriate comments that they found in code.
Here’s what I got – names and exact references changed to protect everyone involved.
Conversations in the code
Code review is important, however, it is best to do it with both the writer and the reviewer present. Otherwise, they may decide that it is best to leave comments for each other inside the code, like so:
/* Jane, talk to me about this - Dana */
/* Dana, this code is perfectly ok, just read it again - Jane */
Some workers just vent while writing code. They are overcome with emotions and have no other outlet so they write the equivalent of graffiti in the code:
/* this is a stupid fix just to shut up them cry babies at
DysfunctoSoft and their Cranky PM */
/* Martha forced me to add this part. I disagree and remove
all responsibility. */
Some programmers are just bad at commenting. Contrary to what I stated above, I left this one untouched:
/* in case of indexsize less than declared key size element with the
next index will be equal location if result of search less or equal
0, (it means that indexSize byte of key are equal or less than
indexSize byte of key of found element) and element with the next
index will be equal location+1 */
How to write bad comments
Want to write you own bad comments, boys and girls? Here’s how:
- If you can write in a non-English language, comment using that language. If you can’t, pretend like you can! Bonus points for foul words. I use Yiddish, especially the word “Drek“.
- Pretend like you and whoever is reading the comments share a secret that no one else should know about. I direct them to nonexistent RFCs.
- Vent out on co-workers and clients. Be specific. Use names. Use pet names. Use the bad names you call them out of earshot. I especially like to use anagrams for customer names.
- Use the code as your very own wall for graffiti. I draw nice little ASCII bunnies, but I hear genitalia are in common practice as well.
Have fun, and be sure to tell me about you and your coworker’s inappropriate documentation in the comments section.