← Back to context

Comment by manquer

7 hours ago

Yes, if you know what you want exactly it is not difficult to rewrite. Writing is the easiest part of coding.

The challenge is knowing exactly what is needed. No matter how bad the code, it is never easy to justify a rewrite .

In a large and old enough code base, documentation is always incomplete or incorrect, the code becomes is the spec. Tens or hundreds of thousands of hours would have been expended in making it "work". A refactor inevitably breaks things, because no single person can fully understand everything.

There is a reason why it is a well know principle don't fix what is not broken. Same reasons why we still have banking or aviation systems still running mainframe and COBOL from 70s.

A rewrite requires the same or likely more number of hours of testing and adoption in a typically much shorter span of time in ironing out the issues [1]. Few organizations either private or public have the appetite to go through the pain and if its money facing or public facing component it is even harder to get buy-in from leadership or the users of app even.

---

[1] During the original deployment the issues(bugs or feature gaps) would have been incrementally solved over many years or decades even. During the rewrite you don't have 10-20 years, so you not only have to expend the same or more number of hours you will have to do it much quicker as well.