Deleting unused code is part of a healthy codebase. Every now and then, a feature gets decommissioned and an engineer is tasked with removing it. Sometimes I'm that engineer. It seems like a trivial thing to write about, but I was pleasantly surprised by how non-straightforward it can be, especially if you're doing it for the first time. There're lots of learning points, especially on how code organization really matters when it comes to maintainability.
Decommissioning a feature is more than just turning it off. It also means hunting down all the parts of code that is no longer needed. And that can be pretty tricky.
It goes without saying that this is by no means the only way to go about doing it. It also really depends on how your codebase is organized. Hopefully this will give you some idea on where to start and things to look out for when you're doing code cleanup.
For some context, our web client at Viki is on the following stack:
- Frameworks/Libraries: Ruby on Rails