Self documenting code is a lie

January 22, 2010 at 05:51 PM | Uncategorized | View Comments

Be very, very wary of anyone who suggests that "self documenting" code can replace comments.

Case in point: I consider myself a mediocre programmer, who is usually capable of producing mostly coherent code.

Below is a hunk of the code I wrote today - keywords are blue, variables are white, comments are green:

I don't think I could take much away from that without doing a serious disservice to the poor person (probably me) who will be tasked with fixing the inevitable bugs in the above code.