I think Elm has two major things that make it such a pleasant detour from what most of us have experienced building web clients:
1. It comes with an opinionated architecture for building apps (model, view, update loop): https://guide.elm-lang.org/architecture/. This constraint is a breath of fresh air if you've ever installed React and then been stuck wondering how you should deal with state. Mobx? Event emitters? Redux? And your app increasingly niches itself into a novel constellation of dependencies. Meanwhile, Elm apps are basically all the same from an architectural standpoint.
2. Strict type system, great compiler errors, no runtime errors. I think the best illustration of this is refactoring power. I've come back to old projects where I certainly don't remember how the code works. I start writing the code that my feature needs (like changing the html to rely on variables I haven't yet defined) and I basically just follow the compiler errors until it works. Or I've made massive refactors like added an archer class to my game that was previously just melee classes which introduced daunting modeling changes to my system, and the compiler essentially gave me a TODO list of all the code sites I needed to update.
Elm certainly involves learning new things, but there's also a lot of work in stitching together a similar concoction of React, Typescript, immutability, etc. In many ways Elm is a vast simplification.
hombre_fatal|6 years ago
1. It comes with an opinionated architecture for building apps (model, view, update loop): https://guide.elm-lang.org/architecture/. This constraint is a breath of fresh air if you've ever installed React and then been stuck wondering how you should deal with state. Mobx? Event emitters? Redux? And your app increasingly niches itself into a novel constellation of dependencies. Meanwhile, Elm apps are basically all the same from an architectural standpoint.
2. Strict type system, great compiler errors, no runtime errors. I think the best illustration of this is refactoring power. I've come back to old projects where I certainly don't remember how the code works. I start writing the code that my feature needs (like changing the html to rely on variables I haven't yet defined) and I basically just follow the compiler errors until it works. Or I've made massive refactors like added an archer class to my game that was previously just melee classes which introduced daunting modeling changes to my system, and the compiler essentially gave me a TODO list of all the code sites I needed to update.
Elm certainly involves learning new things, but there's also a lot of work in stitching together a similar concoction of React, Typescript, immutability, etc. In many ways Elm is a vast simplification.
vmchale|6 years ago
I'd try PureScript next, or ReasonML. But not Elm. Definitely not in production.
the_gipsy|6 years ago
urdumb|6 years ago
[deleted]