Book a 30-min callBook a call

Rewrite or refactor? What to do with code that is holding you back

When an app’s code slows you down, rewriting from scratch is tempting and risky. How to decide between refactoring, a gradual replacement and a full rewrite.

An old block structure with new blocks gradually growing around and replacing it, beside a crossed-out bulldozer.
Written by
BYD Tech
Updated
Topic
Product
Reading time
3 min read

Questions people ask

What is the difference between refactoring and rewriting?

Refactoring improves existing code in small steps without changing what it does. Rewriting replaces the code entirely with a new version.

Should I rewrite my app from scratch?

Usually not, if it has real users. Refactoring or replacing it piece by piece is less risky. A small prototype or MVP is the main exception.

What is the strangler fig pattern?

A way to replace a system gradually: build new parts alongside the old one and move features across until the old system can be retired.

When does a rewrite make sense?

When the product is small, the existing code is a prototype never meant for production, or the technology cannot meet requirements at all.

Building something like this?