When to Rewrite versus When to Refactor
- Kjell Moens
- 15 minutes ago
- 2 min read

A founder once asked me:
"Should we rewrite the whole thing, or just refactor it piece by piece?"
My answer?
Depends on what you're trying to fix—and how much truth your team can handle.
I’ve been brought into both situations:
Teams paralyzed by fear of touching the old code
Roadmaps buried under endless “refactor debt”
Full rewrites that took 6 months and left the company worse off than before
Here’s how I help clients make the call:
---
Refactor when:
The system still delivers value consistently
Your core assumptions haven’t changed
You can isolate the pain to specific areas (auth, billing, UI)
The team can keep shipping while improving
Refactoring is surgical.
It requires discipline, test coverage, and clear interfaces. But it lets you evolve without burning everything down.
---
Rewrite when:
The architecture no longer reflects the business
Everything is brittle, slow, or impossible to onboard into
You’ve pivoted hard, and the system wasn’t designed for what you're now doing
The team already is rewriting it—just informally, slowly, and with zero visibility
Rewrites are risky. But sometimes, continuing to build on the wrong foundation is the bigger risk.
---
The worst option? Half-rewriting in the shadows. That’s when you get duplicated logic, orphaned services, and a team that’s maintaining two systems—neither of which they trust.
When I help teams decide, we start with two questions:
1. Are you trying to improve the system, or escape it?
2. Can you ship value while making progress—or is every sprint just more duct tape?
You don’t rewrite because the code is ugly.
You rewrite because your current system can’t support the next 12 months of bets
コメント