top | item 7509906

(no title)

whyme | 12 years ago

I'll suggest there's a missing ingredient here...I found I was able to eliminate many of my comments by asking myself if that someone whom might read my code would be better served with a unit test instead. I also found, however, that this needs to lead to an understanding that unit test are in fact a form of documentation and should be treated as such.

discuss

order

millstone|12 years ago

It's a great point that, if there's some behavior worth capturing in a comment, you may also want to capture it in a unit test.

But why should you strive for the "ability to eliminate" comments? What is the advantage of having fewer comments?

whyme|12 years ago

I subscribe to the minimalism approach. i.e. I do my best to improve the signal to noise ratio (which is inline with the authors goal).

Also, in many cases, having a both the unit test and the comment is a redundancy.