logoalt Hacker News

slopinthebagtoday at 6:50 AM2 repliesview on HN

A rewrite doesn't need to actually change the public API or experience using the software.

But by rewriting software, even in the same language we can learn from past mistakes and experiences and create better and more maintainable software.


Replies

marginalia_nutoday at 9:30 AM

More often the past mistake is rewriting software in a newer language.

Like I've worked places where the business ran off a layer cake of '80s tech, '90s tech that partially replaced the '80s tech, and '00s tech that partially replaced the '90s tech, and were now on their way to launch a big project to replace all that with '10s tech, a project doomed to run out of steam half way through (because legacy code got hands), inevitably leading to a codebase that consists of three failed attempts to rewrite the '80s codebase, and the '80s codebase.

As the functionality of the code was business critical, and no shift in behavior could be tolerated, they're never getting out of this mess, and would have been better off staying on '80s tech.

It's good for job security that's for certain.

ueckertoday at 7:36 AM

Sorry, I think the idea that rewrites are good way to achieve more maintenable software is basically always based on a delusion. It is a very common and well understood delusion for programmers who always see the existing code as crap and imagine a beautiful world when they could only rewrite it. A well understood mistake: https://www.joelonsoftware.com/2000/04/06/things-you-should-...

In the context of free software it is usually also a method to be able to sideline part of the existing user or developer community, which you can not easily justify when making changes the existing project but can be achieved with a rewrite. But the former leads to a honest view of the trade-offs and consequences where the rewrite is a toxic power move.