Our codebase is slow to change and full of bugs. Should we refactor it piece by piece or just rewrite the whole thing?

Wilmer RodriguezFull-stack software engineering · B12, Ex-Kashiko, Ex-EON Reality

My default is incremental refactoring with the strangler pattern. If it's a massive, tangled codebase with critical business logic, I will always strangler-fig it. I only push for a rewrite when the foundation is fundamentally incompatible with what you need: the architecture physically can't support the requirement, the data model lacks tenant isolation in a way that can't be safely retrofitted, the stack is end-of-life with no security patches, or the module is fully isolated with a clean API boundary and zero blast radius.

Refactoring fixes implementation; a rewrite fixes architecture, and it's only safe when the interface is clean and you can fall back to the old code if it fails.

Wilmer Rodriguez

Generated by an AI mind licensed from Wilmer Rodriguez, not by Wilmer personally.

Ask Wilmer's mind about your case

First answer free · 2 more when you sign up, no card

More from Wilmer