Paul Weber
Paul Weber

Reputation: 6688

Good method to handle large amounts of unused or deprecated feature implemenations in code

Currently we are facing following Problem in our Application:

Around 40 % of the Code that is in the Application is never used. That means the Code would be there, and maybe functional, but the Frontend Feature has been shut off so the Users cannot reach the Functionality anymore or other Methods are replacing the old, now deprecated Methods.

What i am currently doing is removing all the old code while not trying to break anything, manually.

The Question is:

TL;DR: Delete unused code or leave it as it is? Discuss!

u

Upvotes: 3

Views: 243

Answers (2)

bug
bug

Reputation: 659

If you are certain that the code is unused, definitely delete it. I assume you have a version control system, so if you ever need it again, you can still find the code back.

Deleting the unused code will make the project easier to maintain, and your team probably will end up saving time in the long run (nobody will re-read the code to try and understand what it was used for, nobody will end up changing said code thinking it may still be used...)

However, if your code contains a public API that is distributed, you will probably want to mark the classes/methods deprecated for some time before effectively deleting the code, so the callers have some time to adapt (or inform you of the issue).

Upvotes: 4

unquiet mind
unquiet mind

Reputation: 1112

  • Would you remove the old Code, or hope that it may awake some time ... zombie - like

I'd definitely remove it. I hate having to work out if functions ever get called.

  • Do you think that it is worth the Effort to remove the Code (less work to find stuff in the clutter, better test coverage, easier for other people to find their way)

Yes, definitely worth the effort.

  • Should we keep the Code somewhere, as a reference?

Um, you are using version control softwarev, aren't you?

Upvotes: 2

Related Questions