Friday, February 19, 2010

Deprecated is bad in application code

Deprecated should be forbidden and never be used when coding an application.
The sole purpose of the Deprecated tag  ON AN API is

  • It is insecure, buggy, or highly inefficient
  • It is going away in a future release
  • It encourages bad coding practices
( from Java's  Deprecation definition)

When developing in-house software, when you have no outside client of your code it does not make sense at all.
Most of the time it is used when the developer is afraid to delete or modified the class/ method and therefore add a deprecated annotation instead of  refactoring.


It should be part of the code smells indicators along with commented code.

No comments: