The Argument for Elm
Elm is a whole new language, it seems easier to just add redux
Elm adds far more value than redux such as a type system and no runtime exceptions not to mention is a lot easier to understand in elm because ility is enforced for all data structures.
how can we trust elm if it isn't stable yet?
Although Evan has made breaking changes to the language they have been pretty minimal and have always been large improvements. This essentially means that every so often you get an upgrade that will help your codebases quality improve. Also much of that upgrade can be handled by elm-format.
Elm has been around for about 5 years which is far more stable than the JS libraries you would use to replace it
You have to use ports to interact with JavaScript which has a lot of boiler-plate
That's the price you pay for no runtime exceptions and immutability. The elm package ecosystem is very good for it's age. Most of the common stuff would like to do like http, web sockets and interacting with the navigation bar is there.
Wouldn't it be hard to train people on?
Elm is perhaps one of the easiest and most friendly languages to learn. The language itself is designed to be easy to learn and helpful to new people.
It has basically no cruft. In fact the author Evan has basically been systematically getting rid of the dark corners of the language. The language has literally gotten smaller as time goes by. Can't say that for JavaScript can you?
Not to mention think the amounts of code takes to replace it:
- React
- Redux
- Babel
- Web Pack
- Flow
- Immutable.js
- lodash
- time travel debugger for redux?
- maybe even Sass
- Libraries to generate SVGs
- momment (dates library)
That is far harder than one language and a few core libraries.
Also the community is full of very friendly people and help us never far away. Not to mention a whole series of videos for free on egghead.io
What about hiring?
We use Elixir which has a small hiring pool and it's only helped us. People want to work in Elm and would probably would attract more rather than less. NoRedInk said that Elm had drastically improved the amount of people that apply in the Q and A at elm conf.
Not to mention Elm programmers (Elmos?) Are the kinds of people you want to hire: compassionate and smart.
Also think of the flip side, you'll have to hire less people because the ones you have can be more productive plus you'll have less leaving because the front end makes them happy than sob into their pillow.
Also see: http://paulgraham.com/pypar.html
Is it worth it? What do I gain?
You gain:
- Far better Reliability
- No runtime exceptions!!! All edge cases must be handled.
- No problems with null / undefined / nan (Maybe has your back)
- Refactoring without fear of forgetting to find all the usages
- Enforced Symantec versioning. Meaning people can't break the public API without bumping the major version. Not to mention you can diff the changes
- Less tests by making things impossible via the type system
- Faster / Leaner
- Faster rendering
- Less code
- Less complied code
- Easier to understand
- less fancy programming language features that inevitably gets into the codebase
- simpler language overall
- Immutability everywhere (Immutable.js gets confusing and goes against everying else in JavaScript)
- New features
- pipes! (|>)
- Option types to help model different scenarios like loading states or other things
- A good easy to understand module system like Elixir
- Tooling like auto complete and looking up docs inline and a
go fmt
solution - Record types (enforce fields being there)
- More Beginner Friendly
- Friendly error messages
- Better designed browser APIs
- More like Elixir
I feel the pros far outweigh the cons