Functional programming is getting some real traction (no kidding), so here is my two cents: Why you should give @elmlang a try, a thread
1/11
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🐘" title="Elefant" aria-label="Emoji: Elefant">First off, the elephant in the room: Yes, the syntax is weird. Unless you& #39;re already used to it, it is going to be weird for a little while. I& #39;m not going to guide you through it here, but do give https://guide.elm-lang.org"> https://guide.elm-lang.org  a try, it& #39;s amazing.
2/11
That brings us to the first pro of elm: it& #39;s easy to learnhttps://abs.twimg.com/emoji/v2/... draggable="false" alt="🤓" title="Nerd-Gesicht" aria-label="Emoji: Nerd-Gesicht">
Why? Two reasons:
The first one is that it is designed to be simple. The language has been crafted to be an entry point to the scary functional programming world, without the need to understand what is a monad
3/11
Second reason is the compiler (It& #39;s gonna come up a lot in this thread). The compiler has the most explicit errors you& #39;ll ever see in your life, period. Just take a peek:
4/11
The second pro, and in my opinion, the biggest, is the insane promise that your app will never errorhttps://abs.twimg.com/emoji/v2/... draggable="false" alt="✨" title="Funken" aria-label="Emoji: Funken">It& #39;s a wild wild statement that can be hard to grasp at first, but to put it simply, if some code can fail (Like an API call), the compiler will force you to handle it
5/11
Now you may think that sounds like a bother, and you& #39;re right: it is. You have to handle all possible edge cases, always. The good news is, the compiler& #39;s got your back. You no longer have to ship something, hoping you thought of everythinghttps://abs.twimg.com/emoji/v2/... draggable="false" alt="📜" title="Schriftrolle" aria-label="Emoji: Schriftrolle">
6/11
The way elm is built, you can not have errors at runtime. Of course your API call can still time out, but the compiler will make sure you handle that case. Of course a user may enter invalid data, but the compiler will make sure you handle this case too
7/11
All this is possible thanks to the type inference capabilities of the compiler, and the extensive use of ADT, about which I wrote a thread right therehttps://abs.twimg.com/emoji/v2/... draggable="false" alt="😊" title="Lächelndes Gesicht mit lächelnden Augen" aria-label="Emoji: Lächelndes Gesicht mit lächelnden Augen">: https://twitter.com/Euregan/status/1293539071231393794
8/11">https://twitter.com/Euregan/s...
These are, I think, the two main advantages of elm, but if you like numbers, do take a look at the benchmarks (With a pinch of salt, as always): Elm is amongst the lightest, fastest, quickest to build languages for the frontendhttps://abs.twimg.com/emoji/v2/... draggable="false" alt="⏲️" title="Tischuhr" aria-label="Emoji: Tischuhr">
9/11
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🔒" title="Schloss" aria-label="Emoji: Schloss">If security is your thing, know that, by design, a package can& #39;t make any API call, can& #39;t mutate your DOM, can& #39;t start heavy computations, can& #39;t fetch data without you doing it explicitly
10/11
Thanks for reading so far, and if you& #39;re still not convinced to try elm, please tell me why, so I can improve my future threadshttps://abs.twimg.com/emoji/v2/... draggable="false" alt="😁" title="Grinsendes Gesicht mit lächelnden Augen" aria-label="Emoji: Grinsendes Gesicht mit lächelnden Augen">
11/11
You can follow @Euregan.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: