I&#x27;ve done two rewrites at the startup I joined 2.5 years ago of codebases that were our core competitive advantage and that were no longer maintained when I joined. Both of the rewrites were successful, but they were small codebases (5k &amp; 10k LoC) and I was the expert on what they were meant to be doing. The first one was our client-side analytics product that I ported from a single 5k LoC CoffeeScript file to TypeScript, the second was a Node.JS&#x2F;CoffeeScript application that I ported to Java&#x2F;Groovy.<p>I think the move to TypeScript was probably the one with the least clear benefit; Our lack of experience with CoffeeScript and the compiler&#x27;s lax semantics were causing us problems, but we could have moved to pure JavaScript. I like TypeScript and I feel more confident refactoring and merging with a statically typed language, but it&#x27;s hard to quantify. This took about 6 weeks, though most of my attention going to fighting customer-facing fires during this period. Launching this was excruciatingly stressful though because there was a bug we could only tell existed through aggregate A&#x2F;B test statistics.<p>The second one from Node.JS&#x2F;CoffeeScript to Java&#x2F;Groovy has seen more clear benefits from being on the JVM since our team has more experience with it overall, both in Dev &amp; Ops, and a direct port boosted perf 3x and we&#x27;ve benefited from the more extensive library support and interoperability with other JVM languages we use elsewhere in our system. This took about 2 months to go from nothing to prod. It was also useful organizationally since we&#x27;d talked about rewriting it for so long that we&#x27;d been treating the existing system as legacy and not wanting to invest any extra time in that codebase for that reason. Releasing this was comparatively easy since it essentially acted as a streaming transformer, taking JSON in from one queue and emitting JSON out another queue without any state and I could confirm that the new system had only irrelevant changes. Still, half of this time was spent on testing.