Good comments are no substitute for bad code. I come from the viewpoint that if my class is too difficult to understand without comments, then it needs to be refactored. If my function name does not clearly relay its intent, what it takes and what it returns, then I need to rename it. Commenting needs to be prioritized on a return-on-investment basis. Making commenting mandatory will lead to sloppy comments. If you cannot comment your code, you are forced to write readable code, something I feel is much more important and useful.
It is getting late, and I want to check in my 50 classes. Thankfully, I installed Roland Weigelt's "GhostDoc." This free Visual Studio add-in makes generating XML documentation comments for C# more manageable. It is configurable too, so I can choose how I want my comment styles to appear, set hot-keys, and more. Check it out. It certainly makes commenting easier.
I would be interested to hear your opinions on commenting. Can you apply general rules to it? How much is too much? How much is too little?
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2010 MuellerDesigns.net
Sign In