Stop Rewriting Everything: The True Cost of Re-platforming
We all know the feeling. You join a new team. You check out the main repository. You look at a massive, aging AngularJS or early React 15 codebase and your immediate instinct is to burn it to the ground.
"Let's rewrite this in Next.js," you say. "It'll only take three months."
It never takes three months. It takes twelve. And during those twelve months, your competitors are shipping actual features while you are busy recreating a login screen that already existed.
The Re-platforming Delusion
The urge to rewrite comes from a place of arrogance. We assume the engineers before us were idiots. We look at a messy file with 2,000 lines of spaghetti code and assume it was written that way out of malice.
It wasn't. That spaghetti code is the result of five years of edge cases, customer bug reports, and hotfixes. When you rewrite a legacy app from scratch, you aren't just deleting bad code. You are deleting five years of hard-earned business logic. Do you really remember why that weird setTimeout was added to the payment gateway module in 2019? You will find out the hard way when it crashes in production.
The Strangler Fig Pattern
If you want to operate at a Principal level, you must master the art of the in-place refactor. Use the Strangler Fig pattern.
Leave the legacy app running. Build new features in your modern stack (React, Vue, Svelte, whatever you champion) and route traffic to the new micro-app at the CDN level using Cloudflare Workers or Nginx.
Then slowly, page by page, component by component, move the old logic into the new stack. Replace the legacy system from the inside out. It isn't glamorous. It isn't a massive "v2.0" launch. But it is safe, it delivers continuous value to the business, and it is how professional engineering is actually done.
Your job is not to play with the newest framework. Your job is to make the business money without breaking what already works.