15 December 2019

On Value of Inactive Code - Part II

A few months ago I wrote a rant about unused pieces of code lying around the codebase. And, recently, we had to deal with it.

Some users were complaining about a bug which was rarely occurring, but was very annoying and was thus given high priority. It took a pair of developers two day-long attempts to finally pinpoint the root cause. And what it was? A part of an old method not intended to be ever executed (guarded by malfunct if statement) as it was replaced by new approach. It was left checked in “just in case”.

The fix was simple - just delete obsolete part of method.

Conclusion: Inactive code should be removed sooner rather than later.