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 RealityMy 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
- We're adding AI generation to our app. Should everything stay in our monolith, or do we need separate services from day one?
- We need our MVP out in weeks. What corners can we safely cut, and what should we absolutely not skip?
- Our app keeps getting slower as users grow. Should we just add caching everywhere to speed it up?
- We're adding an LLM feature that chains a few model calls together. What's most likely to break once real users hit it?