TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Do not rewrite code if you do not understand the code

1 pointsby weejewelover 4 years ago

3 comments

jimmyvalmerover 4 years ago
Whether one fully understands or not, rewriting always results in chance of breakage. Ceteris parabus I always favor rewriting if only to allow the rewriting programmer easier maintenance going forward. When the breakage reveals why the old code was written in that peculiar way, the hope is that the cost of breakage is less than the time cost of understanding the peculiarity. Obviously, for big stakes, e.g., the Google search algorithm, this "move fast and break things" ethos is untenable.
verdvermover 4 years ago
You can rewrite on a branch and not merge it, no problem.<p>I&#x27;ve used this technique to learn and teach code bases.
bediger4000over 4 years ago
This actually hints at a trap. There&#x27;s something akin to the Dunning-Kruger effect in programming, because code is in a Turing-complete language. You can&#x27;t necessarily understand it, but you might believe you understand it. Some weird side-effect gets eliminated or introduced and then your system starts failing.