17

Remove Dead Code


Goal

Every line in the codebase is reachable and used; readers don't waste cycles on phantom branches.

Before the refactoring
function legacyDiscount(order) { /* unused since 2018 */ }
function modernDiscount(order) { /* the real one */ }
After the refactoring
function discount(order) { /* the real one */ }
Savings

Smaller surface, faster reading, fewer false leads when debugging.

Note

Code that looks dead may be reachable via reflection, dynamic dispatch, or external callers — delete in version control where it can be recovered.