The Usefulness of Commented Code

time to read 2 min | 226 words

In general, my approach to commented code is fairly simple, continious application of the delete key until it no longer exists. I have a source control, thank you very much, and except for short periods when debugging, I absolutely abhor it.

One case where I do leave the code commented is when its absence is something that a later programmer (such as myself) will try to add, with usually unpleasant results. Here is a simple example:

/* Explicitly not checking this, since it is not part of the template

 * Assert.AreEqual("3", GetText("AdditionalNumber"));*/