With a title like that you have to back it up. It's a shallow article.
> why it was worth doing, because it wasn't, at least not to the business. The application did the same job for the same users at the same speed as before.
Application have many other properties then "doing their job". Running cost, maintainability, ... it's endless. Any of them going seriously wrong can tank the company owning it.
But I agree, rewrites are very often bad. I've been the customer of two banks that spent years to rewrite their online bank. It was crap and missing features! But maybe they got something out of it.
Never fix a bug without having first written a red test.
Never just write code. Always write red tests first.
In fact you can do even better and have your agent write end-to-end tests first as acceptance tests, have it witness them fail, then have it do red/green at the unit/component/integration level. Once it’s done the e2e tests pass, have it send the code off for linting and self-review.
If you are vigilant you’ll end up with a trustworthy validation suite. And with that (especially with e2e coverage), you can refactor and rewrite as much as you like.
A perennial insight which has been articulated many times before. This feels like one of those stages all engineers pass through at some point in their growth journey. Chesterton's Fence and all that (or Joel Spolsky's "never do full rewrites" advice).
It’s also worth taking a look at the git history of the repo. The current state is an accumulation of scar tissue, but you can see the actual reasons behind some things by figuring out why they were added in the first place.
good rewrites are good. bad rewrites are bad.
you’ll only find out which kind of rewrite you’re doing once you start it.
The article is AI slop, obviously, like practically everything on the internet these days it seems. Awful writing, circling endlessly around the same point. The entire article could have been a single sentence. Which of course, is how it began. As a prompt.
The article is also wrong. Or, at least, indicative of a broken relationship between management and engineering. If you have an engineer who can decide to rewrite the entire product without management buy-in, then that's an organisational and a discipline problem.
Added to which, of course, maintainability and build-ability both matter an enormous amount. Work to improve both of those things will improve the business.
> I barely knew CakePHP, so every file looked wrong to me. I knew Laravel, and I loved working in it. So on my own time, unasked, I ported the thing piece by piece, swapping in Illuminate packages until the old framework was gone.
Title is somewhat clickbaity, because these actions are not what people are going to think of when they think of a rewrite in a corporate environment.
By the way, I was an early employee at Amazon.com and the website’s rendering engine was rewritten three times, each time unlocking a new level of productivity without which the site (as well as the velocity of teams) would have slowed to a crawl, and the company would have probably died.
Very rarely have I heard an engineer look at a functioning piece of software and go “let me rewrite this because it’s not a language or framework I am familiar with and fond of”. If that does happen, it’s usually inexperienced (or bad) engineers.
Rewrites usually start with a gap in what is available and what is needed: missing functionality, existing frameworks getting obsolete, difficultly maintaining code because of the existing implementation complexity, costs, scalability issues, compliance challenges, etc. Most of these things serve the business more than the engineers.
Is this news to anybody? Feels like I should just point AI and several “foundations of software engineering” and have it churn out blog posts for each chapter.
This rings so very true. Have been in the software business for too many decades and having inherited other people's code many many times, there is always the decision about what to do going forward. Leave it running, refactor it gently or rip and replace. Each has it's own set of traps that need to be carefully considered.
serving the engineer _does_ serve the business, ultimately.
Yahoo bought Viaweb from Paul Graham and rewrote the Lisp application in C++ and Perl. Reports are the results were strictly inferior but it achieved the goal of not having to rely on Lisp programmers.
Part of Yahoo's business is/was hiring programmers reasonably cheaply and controlling them reasonably easily - to allow Yahoo itself to sell parts or all of itself.
So things aren't quite a simple as "this doesn't serve the product", sometimes the engineers (and their replaceability) are part of the product.
> For a few weeks one summer I woke at 4am to rewrite code my employer had already paid someone to write.
I mean, if you do it at 4am, you are sleep deprived by the day two and thus unable to stop yourself from something stupid.
[flagged]
If you commit to being around for all the support calls, then do any rewrites you want. But the rewriters unfortunately tend to use it to pad out CVs and move on.
The "When touching it is the right call" is the tricky part, because it contains this very subjective exception: "Every new feature costs three times what it should because of the design, and you can show the trend."
I've been in situations where I was sure this was true. I've also been in situations where the person claiming it simply refused to become competent in the language, framework, or persistence technology that the system was built on.
Also subjective: "The business needs a capability the current code was never shaped to grow into." Most of the times I've heard this brought up, it's not that you need a re-write, but you need a re-architecture. Often the existing system can continue to do its job as it always has, but in a new architectural context. Or 90% of the code can stay the same, while the application it runs in is changed, for example from a web service to a Kakfa consumer. (This is why it's so important to avoid languages and frameworks that are tightly bound to an architectural choice.)