
Ask HN: Why or why not should I use Elm instead of vanilla JS? - todd_wanna_code
I am a programming noob. Recently after learning about paradigms, I found the functional approach easier to grasp than OOP. I have been using Haskell and JS for learning primarily. So is there any reason to learn Elm? I know Elm is a domain specific language, but does it have any disadvantage that I should know of before starting with it?
======
brudgers
My experience, which is of course _my_ experience, has been that programming
languages built on JavaScript such as Elm and ClojureScript wound up being
harder to learn than Vanilla JavaScript. The reason I think is that JavaScript
programming is really two different things. There is the language, JavaScript
and its syntax and semantics...this is where the differences between
imperative and functional and object oriented techniques show up. Dynamic
versus static typing and namespacing/modules also show up as differences
between the languages.

The other JavaScript is the Browser/DOM API. This is not syntax and semantics.
It is approximately function calls to a standard library. Elm and
ClojureScript and TypeScript and what have you, may wrap this in a library or
a different API. But, at least for _me_ , this does not solve my problem of
being unfamiliar with the underlying abstractions. Even worse, once I
scratched the surface to learn an abstraction, for example Service Worker, I
was on Mozilla Developer Network looking at JavaScript. Without understanding
JavaScript, I gave up "official professional" documentation for ClojureScript
or Elm "amateur" documentation of the underlying JavaScript abstraction.

Finally, _my_ specific conclusion about Elm was that it is not worth _my_
effort to keep up with breaking changes. Blog post code samples and tutorials
seem to go out of date every few months. Not just a little, but irreparably
out of date. If Elm ever stabilizes around a spec or something like a spec, I
may take another look. But for _me_ , it feels like a case of perfection as
the enemy of excellence.

Good luck.

------
dsiegel2275
I would say that you should consider using Elm instead of JS if you are
building a web application and you care about reliability and maintainability.

With Elm you will have a ridiculously stronger guarantee that what you write
won't break at runtime. The type system and compiler also allows you to
refactor with confidence.

Vanilla JS, unless you write exhaustive unit tests, gives you neither of these
benefits.

