Code that is no longer used or needed.
Problems
- Maintainability
Solutions
- Remove the code
- KISS
Examples
- Gold plating code or Yagni code.
Exceptions
- Avoid metaprogramming. When used it is very difficult to find references to the code.
Sample Code
Wrong
Right
Detection
Coverage tools can find dead code (uncovered) if you have a great suite of tests.
Tags
- Unnecessary
Conclusion
Remove dead code for simplicity.
If you are uncertain of code you can temporary disable it using Feature Toggle.
Removing code is always more rewarding than adding.
More info
Relations

Code Smell 54 - Anchor Boats
Maxi Contieri ・ Jan 6 ・ 1 min read
#codenewbie
#webdev
#tutorial
#cleancode
Credits
Photo by Ray Shrewsberry on Pixabay
Discussion (0)