Tangential comments about Software Development

Wednesday, November 28, 2012

Comments on Comments

Commenting code is /* a sign of */ weakness. Going back to code I wrote years ago, I don't think I wish there were more comments. I am thankful when functions are short and well-named.

But when I don't know what's going on, I do comment out things in order to be able to re-instate them if I'm wrong. In that case, comments are cautious, deleting is over-confident. I watched a colleague change a Wordpress template by deleting stuff until it worked. We deleted more than we needed, so who knows what's broken. I would have commented out something, and if it didn't fix the problem, uncomment it afterwards.

In my meta-data driven project, where I really don't understand the accounting principles, I leave lots of stuff "commented out" in various ways. Once it's all up and running I shall delete it. I promise.

P.S. If the software industry could start again could we have just one commenting method, not // -- ## <!-- ' REM and all the others that don't immediately come to mind.