There is a diplomatic mindset that many developers have: It’s better to orphan code, than it is to delete it. This, although less destructive in the short term, can become very destructive in the long run. Leaving orphaned code may:
-
Encourage Reuse later on
-
Dramatically increase build times
-
Increase the amount of time needed to perform version control [A bigger code base takes longer to examine]
-
Reduces one’s ability to navigate through the code.
-
Increase the executable size
-
Increase maintenance times
So in short: If the code is no longer needed and used, remove the dead code. If you’re using source control properly, the change can be reverted.
If the team you are working with still insists on orphaning code, at least have them to agree on periodic spring cleaning of the project.
Good News to those who use Maven and are working on J2EE web projects in IntelliJ: Here’s a guide.