Codementor Events

How I stopped hating Javascript and learned to love Elm JS

Published Jan 27, 2019
How I stopped hating Javascript and learned to love Elm JS

About me

I'm an experienced Rails developer.

Why I wanted to learn Elm JS

I find the incidental complexity in Javascript frameworks unpleasant. The build tools are a mess, the dependency management is a nightmare and even though React is a step forward, it's nowhere near enough for me.

How I approached learning Elm JS

I did the simplest thing that could possibly work - installed Elm JS, copy and pasted an example, got it working in the browser.

Once I'd got it working, I chose another example that was closer to what I wanted to do and, one very small step at a time, evolved the code towards the solution I wanted all along.

Challenges I faced

The biggest challenge was getting my head around the style of Elm. I'd dabbled in bits of functional programming before - Elixir, Clojure - but Elm is pretty pure.

The syntax is very weird at first, plus the formatter does things very differently.

The compiler was incredible though - it actually taught me most of the language! I had to Google for one or two things in the first 10 hours.

Key takeaways

I loved the compiler and how plain English the error messages were! It was a wonderful experience - possibly the best experience I've had learning a new language.

One of the best things about Elm is how it makes you realise just how terrible most languages are at the basics. Compilers have always been the enemy of productivity for me. Elm flips this on it's head and shows how actually compilers can be your best friend.

I'll never see compiled languages quite the same way ever again.

Tips and advice

Get stuck in - do something ridiculously simple. And don't read lots thinking "eventually I'll get this". Just dive in and don't flip out when the code doesn't compile - that's where the work is!

Final thoughts and next steps

My next goal is to use this in a production project. Merchant Ads or Talk GDPR are ideal candidates.

Discover and read more posts from John Gallagher
get started
post commentsBe the first to share your opinion
Noel Kelly
5 years ago

Not entirely sure about referring to this as “Elm JS”. It’s a language all on its own, just so happens to compile to JS! :)

Show more replies