Coding Practice: Commenting Code

Coding Practice: What is the appropriate amount of comments for my code?
Comments are usually an indication that the intent of your method or class is not clear.  In general you should strive for no comments.

Quote:
“Comments are indicative of a quality problem.”
– Scott Allen

Application:
Express intent and clarity through well named variables, methods, and classes.  The only exception would be when you want to express the reason for a particular pattern/design   choice that cannot be expressed in the code itself.  Do not be afraid to use long names to help create clarity and remember that if you are applying the Single Responsibility Principle, then there should only be a single intent that you are trying to communicate through your class and method names.

References:
Plural   Sight: Test Driven Development – Part 1
www.edx.org   – CS169.1x: Software as a Service

About Chris VanHoose

Principal Software Architect at CT Lien Solutions
This entry was posted in Software Architecture and tagged , . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.