The other day, Elon Musk and George Hotz mentioned that Twitter would probably need a full rewrite to get to the place where it could reliably and quickly ship new features. There was a lot of pushback from the infrastructure side – many developers who either maintain legacy software for a living or were the ones who originally wrote it. Two laws often cited –

Rewrites are a hard sell to customers: why should they switch to another platform (with minimal enhancements) when they're already using a product? It's easier to sell new features and improvements to existing clients than it is to sell a different product.

It is also difficult to objectively compare the original and rewrite, as both products will share some DNA (i.e., the same core architecture or design). In practice, it's usually easier to measure incremental changes (magnitude over timing).

But sometimes rewrites are necessary.

Sometimes the market changes, and a new architecture is needed. That might be a shift from on-prem to cloud (or cloud-prem). It might be a heavyweight and centralized stack vs. a serverless one.

Sometimes it's hard to hire for an outdated technology stack (e.g., why FORTRAN developers are highly paid).

Tooling Changes – while developers today have it pretty good with great tools like Kubernetes, Docker, Helm, and countless other projects, these weren't around 5 years ago. Sometimes rewrites make sense because the developer experience has improved drastically since then: better monitoring tools; stronger security primitives; new technology stacks that weren't previously applicable (e.g., cloud computing).

So does Twitter need a full rewrite? I don't think it would solve Musk's goals (which, I'm assuming, is positive free cash flow and increased growth). Some actual alternatives to a full rewrite (assuming you're inheriting a poorly written codebase that you must rewrite):