Code Smell 05 - Comment Abusers

Subscribe to my newsletter and never miss my upcoming articles

Listen to this article

Code has lots of comments. Comments are coupled to implementation and hardly maintained.


  • Maintainability

  • Obsolete Documentation

  • Readability

  • Code and comments duplication.


1) Refactor methods.

2) Rename methods to more declarative ones.

3) Break methods.

4) If a comment describe what a method does, name the method with this description.

5) Just comment important designs decisions.


  • Libraries

  • Class Comments

  • Method Comments

Sample Code



Linters can detect comments and check the ratio of comments / lines of code against a predefined threshold.


More info


  • Comments

  • Declarative


Leave comments just for important design decisions. Don't comment a method with a bad name, rename it.


Photo by Volodymyr Hryshchenko on Unsplash

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.

Martin Fowler

This article is part of the CodeSmell Series.

No Comments Yet