3 ms·
Switching languages is THE most efficient way to refactor a messy codebase. The past color the idea that a language switch is a waste of time, because in the p
by mamcx 6y ago
Switching languages is THE most efficient way to refactor a messy codebase.
The past color the idea that a language switch is a waste of time, because in the past the choice of languages was from worse to bad or for same to same-ish.
But MODERN languages have something that make this compelling: Actual good practiques baked in the language, as defaults.
---
So, if a codebase is in trouble you can:
- Try to refactor it with "better" idioms...
but if this is not the norm in the language/ecosystem you depend in discipline, and that have proved to fail at scale.
- Change to "shinny lang" where do the right thing is the default...
And now if the developers try to do wrong, them will fight against the current.
---
Switch to Go is a great way to solve a project with concurrency issues: Go is good at that, and make a compelling case of build good concurrency apps. Similar if switch to Elixir/Erlang.
The case of Rust is similar: it make the "best" practiques the default, and very painful to do wrong (and sometimes to do right, but this is not the focus here :) ).
So, a language switch is the ultimate clean up for a project.
I have done several in the past (I'm contractor) and let me tell you: Any codebase I get is in deeeeeep trouble.
The best results have been a language switch, when I move from "bad" to "better". Just the fact the new language have something that is truly better make the move great.
Now, the opposite is true: If you are switching and NOT because the new language have that something that is truly in need or worse, is a language with the need of a LOT of discipline (like C, PHP, JS,...) then yeah, is doomed...