Code that is no longer used or needed.
- Remove the code
- Gold plating code or Yagni code.
- Avoid metaprogramming. When used it is very difficult to find references to the code.
Laziness I: Meta-programming
Meta-programming is magic. That is the main reason why we should not use it. There are many dire consequences on the…
Coverage tools can find dead code (uncovered) if you have a great suite of tests.
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.
This article is part of the CodeSmell Series.