in

Blog By Bob

Blog by Bob

Stop Already

When people say 'Comment your code!', they are not saying that you should comment your code just because someone said to.

//Save the data
myObject.SaveMyData();

Blah.

Rules of Commenting:
Avoid comments that explain the obvious.
Write readable code, don't comment unreadable code.
Appropriately name variables and methods.

Now, all of your code is self documenting, no one should have trouble figuring out *what* your code does. Comments explain *why* your code is doing it.

 

Exceptions:
All methods should have XML documentation filled in fully. Then they only need to read the intellisense and not the code. If the method is properly refactored and scoped, it should be enough.

Published May 25 2007, 01:09 PM by Bob

Comments

 

TimothyP said:

The only problem with the XML comments is that it bloats the source code and makes it actually harder to read... but still we have to use it of course :p

August 4, 2007 3:23 AM

Leave a Comment

(required)  
(optional)
(required)  
Add
Copyright © :: BlogByBob.com
Powered by Community Server (Non-Commercial Edition), by Telligent Systems