Code Smell 05 - Comment Abusers
30 July, 2022
4
4
0
Contributors
TL;DR: Leave comments just for important design decisions. Don't explain the obvious.
Problems
•
Maintainability
•
Obsolete Documentation
•
Readability
•
Code and comments duplication.
Solutions
Examples
•
Libraries
•
Class Comments
•
Method Comments
Sample Code
Wrong
Right
Detection
Relations
Refactorings
More info
Tags
•
Comments
•
Declarative
Conclusion
Credits
If you have to spend effort looking at a fragment of code and figuring out what it’s doing, then you should extract it into a function and name the function after the what.