Knowledge
Search knowledge... ⌘K
Knowledge · Anti-Patterns
Smell Comments
Anti-pattern indicating need for refactoring
Tags
refactoring-fowlercode-smellmaintainability
Impact
Comments often are used as a deodorant for bad code. When you feel the need to write a comment, first try to refactor the code so that any comment becomes superfluous.
Symptoms
- Comments explaining what a block of code does
- Comments needed because method name doesn't explain purpose
- Comments describing required system state
Source
Martin Fowler — Refactoring: Improving the Design of Existing Code, 1st Edition (1999)