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
Like this:
Like Loading...
Related
About Chris VanHoose
Principal Software Architect at CT Lien Solutions
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
Share this:
Like this:
Related
About Chris VanHoose
Principal Software Architect at CT Lien Solutions