3 ms·
This is one of the reasons why statically typed languages have a big advantage when it comes to maintenance. Take Scala for example. There is now mature toolin
by valenterry 6y ago
This is one of the reasons why statically typed languages have a big advantage when it comes to maintenance.
Take Scala for example. There is now mature tooling for keeping your dependencies / libraries up-to-date automatically, using automatic migration-scripts (must be provided by the library author of course).
See here: https://github.com/scala-steward-org/scala-steward/blob/master/docs/scalafix-migrations.md https://github.com/scala-steward-org/scala-steward/blob/mast...
The difficult part here is of course to write the migrations. This works very well in Scala (and can work as well in certain other languages) because the type-system provides enough information to do automatic rewrites and it is easy to _not_ use unsound techniques such as reflection, code generation, macros etc.
The reason why we don't see such tooling in other languages yet is that they are either dynamically typed, which makes it almost impossible to write migration scripts that pretty much always work. Or they are statically typed but the typesystem is so limited that developers have to fall back on mentioned unsound features.
- pdimitar 6y agoThat was basically my main reason to learn Rust (okay, mega-speed is another but it wasn't the first): no matter the syntax, no matter how hard it is to learn in general, no matter how hard to learn and use all the idioms is, you have a very strict language that makes it that much easier to automatically refactor. ...Or at least I hope that will be the case in the future. But like you, I believe it's much better positioned to do so compared to the dynamically-typed languages.
- makapuf 6y agoI'd say it's harder to refactor because you can only refactor to correct programs. Other, more lax languages are easier to refactor to a wrong new state.