Fundamentals 6 min read

When Is Rewriting Code Worth It? Lessons on Cost, Risk, and Value

The article argues that rewriting already‑deployed code rarely adds real product value, incurs high costs and risks, and should only be considered when the existing system is so outdated that a fresh start is the only viable solution.

21CTO
21CTO
21CTO
When Is Rewriting Code Worth It? Lessons on Cost, Risk, and Value

From a company perspective, if a system is already released to customers, rewriting it is not advisable.

From an individual perspective, one may rewrite privately to improve skills, but should not attempt to replace the live version.

Newcomers often see only superficial issues like messy code, overlooking the many problems already solved by the system.

Even experienced developers may fail at rewrites because memory of past decisions fades, leading to suboptimal solutions.

Key argument: It's harder to read code than to write it.

Writing code is easy, reading code is hard.

Main points:

Even if rewritten code matches all functionality and performance, the product gains only marginal competitive advantage; code clarity mainly reduces long‑term maintenance cost.

Rewrites consume extra time and money; unexpected issues (budget cuts, staff turnover, unmet performance) can make the effort disastrous, sometimes resulting in a product that fails or is inferior.

Good architecture design early can lower hidden maintenance costs, but after a project is live, rewriting usually offers at best marginal benefits while risking failure.

If a project is so outdated that new features cannot be added, creating a new project and rewriting there is the sensible choice.

Ultimately, recognizing problems as opportunities and aligning code decisions with business goals determines success.

Source: Zhihu discussion (http://www.zhihu.com/question/29941041)
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Software Engineeringsoftware maintenanceTechnical DebtProduct Developmentcode rewrite
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.