Ask HN: Should I learn Elixir or Erlang first?

29 points by bontoJR ↗ HN
I quickly checked Elixir and I was surprised by how beautiful seems the language. I have been attracted by Erlang since ages, now I have the time to learn it. But Elixir seems great, so: should I go Erlang first or can I jump directly to Elixir? What do you suggest?

10 comments

[ 3.1 ms ] story [ 40.5 ms ] thread
I would strongly recommend to start with Elixir. It is much easier to learn and once you get used to Elixir, learning Erlang is not a big deal anymore.
If elixir seems easier to learn, try it first. Both Elixir and Erlang use OTP, so after diving into Elixir it will be much easier to learn prolog-like erlang syntax. Also in elixir you can call erlang modules, so you can get familiar with erlang when using elixir.
Thanks, very ponderate and effective answer.

I was actually thinking about go Elixir-first, but I was in a need of a kind of "validation" about the order from someone that already wrote some code for both.

Elixir is more complex language than Erlang, simply because it has more concepts, similarly like Scala introduces much more concepts than Java. Yet to productively use Elixir you need to have basic understanding of Erlang, BEAM VM and OTP - correspondingly for Java it will be Java, JVM and some app server like Tomcat, Spring, Play, OSGi, etc.
I have been learning Elixir first and have found that understanding Erlang "as I go" is much easier. Start with Elixir and "keep an eye on" Erlang, it's fine. Eventually I noticed that I was already pretty good at reading Erlang, just by "light exposure" via Elixir. I would even argue that learning Elixir first HELPED ME to understand Erlang!

I still strongly prefer Elixir syntax, of course!

As in most things, you should "do what feels right" and not worry about it too much

I highly recommend reading Programming Erlang by Joe Armstrong first. It's a great read, it's quick, and it will make you a better dev, regardless of language. Once you've read it, then go write Elixir. Elixir's syntax and string handling address the primary complaints about Erlang. And, having read the Erlang book, you'll have a better idea of what is going on under the hood. That will will serve you well if you end up off in the weeds, or need to use an Erlang library for something.
Wasn't aware of the book, I will definitely check it!
I really can't recommend that book enough. I tried to learn Erlang last year with another book, but eventually I got bored and moved on. This year I decided to give it another try, so I bought Programming Erlang and I absolutely love it. The material is presented with the pacing and skill of a master craftsman teaching an apprentice. Joe's writing style is flowing and entertaining, but not silly (cough), so I really enjoy reading every chapter. And the exercises at the end of the chapter are perfect. If there's not a lot to really do, he doesn't throw filler in there. But if there's important things to understand, there will be plenty of unique problems to solve.

Such a great book, and such a fun language.

Elixir is more approachable so I'd start there, but you're going to have to pick up Erlang along the way, at least being able to read it, so take it as it comes.
I'd say jump into the non-OTP language features of Elixir first to get the basics of Elixir/Erlang's approach to FP. Maybe do some of your own process spawning and linking/monitoring. After that dig into "Learn You Some Erlang"[0] and/or "Erlang/OTP in Action" to learn what OTP is and how to use it.

I definitely recommend Elixir first, though. The development tooling are so good that they get out of the way while you learn the language whereas in Erlang you'll be immediately confronted by its lack/complexity of tooling.

0 - http://learnyousomeerlang.com

1 - http://www.manning.com/logan/