Considering Elm Lang for future

I had heard the name Elm in a few talks and discussions so I decided to spend time learning it and do a small project with it. Knowing what the strengths are might change your decision to continue or start a project.
A totally different programming paradigm is on the rise and it’s fast forcing developers to rethink the way they code. Known as Functional Programming, this method can fit into an existing programming language such as Javascript with the added benefit of being easier for other developers to understand.
What is functional programming?
Functional programming is a programming paradigm that has almost no common ground with traditional programming paradigms like imperative or OOP.
- Functional purity
- Data Immutability
Elm is a programming language that compiles to Javascript. It’s also fully typed, with its creator boasting that it never has any runtime exception.
Strong static types → finding errors fast with readable compiler messages
- No null or undefined → impossible to leave possible problems unhandled
- Immutability & purity → readability and maintainability
- No runtime exceptions → incomparable reliability
ELM’s Architecture
The concepts around the Elm architecture at its core are starting to be more widely used. For those of you familiar with Redux, it is very similar to that. The Redux project has looked at Elm for inspiration. It is a simple architecture and the documentation does the best job of simplifying it:
The logic of every Elm program will break up into three cleanly separated parts: Model — the state of your application

Update — a way to update your state

View — a way to view your state as HTML

As you see, the syntax is quite different from what you are used to it in JavaScript. But it has a complete idea of how to build the project and how to keep it in a standard way.
Performance
Elm has always done well with performance due to its compilation to efficient JavaScript and use of the virtual DOM model.
ELM vs React, Angular and few others
- Both Elm and React are installed using NPM, the Node Package Manager. Elm is globally installed and provides its own package manager.
- To communicate with JavaScript code, you can pass things into Elm with flags for one-way communication
- Elm-reactor, a built-in way to create and test Elm components and applications rapidly
- Elm doesn’t have as many packages as React

Drawbacks
Elm is not Javascript. Although Elm is tremendously beneficial for any developer that wants to work with a functional programming language, the reality is that the expertise gained by working with Elm is not easily transferrable to any other frontend framework.
Elm doesn’t support server side rendering. The support is on the Elm language backlog, so right now it only works on browser. Therefore, if SEO is important to you, don’t choose Elm.
DOM is off limits — you can’t measure the width and height of a rendered element and make decisions
Stateless messages — mimicking a “click” event is not trivial as in Javascript.
Conclusion
Apart from all the features of having a compiler and zero exception on runtime, Elm has a little learning curve and more importantly to me, not having an access to DOM, which is basically the reason why it doesn’t have error on runtime.
Also having a strong server rendering language, is more important for almost all the websites that Im working at the moment.
Hopefully in future, we can see that community is working more on this language to make it better.
If you have decided to move to Elm, remember using Less for style might be safer for styles because if you changed your decision, you only need to rewrite the code not just the JS.
Be also mindful if you want to move in to Elm, you can use the compiled JavaScript as part of your project, so start with just few components and then dive in!
Follow me on my Medium to see more posts!
More
- https://frontendmasters.com/courses/elm/
- http://elmprogramming.com/