Hacker News new | ask | show | jobs
by strken 673 days ago
In the majority of places I've worked, nobody who started refactoring older code piece by piece ever finished it. The exception is people who documented the scope of the work, got leadership buy-in, and then worked on it continuously like any other project.

The problem is that sometimes the new pattern gets overridden by an even newer pattern, and so on, until you've got three different implementations from 2016, 2019, 2021, and then you find that in 2024 you're working on implementation number four and all the people who did the first three have left the company without writing any documentation or finishing their work.

2 comments

In a sufficiently large codebase, this is just simply inevitable and you just have to accept it as a fact of life. If you have millions of lines of hand-written code, you're going to have archeological layers and some pockets that are more modern than others. It's not great but "everything is locked into a pattern established in 2003 and you can't innovate" is a worse problem.
This is why I always ask "Is this going to leave our code in a better or worse position if we abandon yhis half way through". If the answer is "worse" then don't start it. Not unless you can get the entire thing done in about a week. If it takes a quarter, the probability of reprioritization is way too high.