Commenting Can Be Bad For Your Soul

Tweet this Print

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 */

Disgruntled remarks

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. */

Dis-informative comments

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 */

Nuff Said.

How to write bad comments

Want to write you own bad comments, boys and girls? Here’s how:

  1. 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“.
  2. 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.
  3. 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.
  4. 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.

Ran Arad

Ran Arad is a veteran developer in RADVISION's Technology Business Unit, dealing with protocols, media and everything in-between.
Tags: , , , , ,
Tweet this Print

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>