I’ve just made the Javascript transition. I’m two months into it and feel pretty comfortable.
My favorite is Stephen Grider’s Complete Phoenix and Elixir Bootcamp. It’s slow but very comprehensive. If you like a lecture format, this is where I’d start.
I also got quite a bit out of https://www.learnelixir.tv The videos are very dense and quick.
There are good program challenges on Code Wars
Dave Thomas’s Programming Elixir is great, as everyone mentioned.
I’ve held off on the OTP stuff. Javascript is goofy being single threaded, synchronous execution context with a separate event loop. Elixir has great async helpers to “simulate” a JS event loop. For threads, If you’ve worked with Node and spawning child processes, then you know when and how OTP might be advantageous. If you’re designing web apps like me, my opinion is deep diving OTP is overkill. I’ll wait until I need an OTP optimization and then go for it.
My biggest Elixir struggles aren’t functional programming, pattern matching, recursion, or the rest. It’s the vast number of data types, macros, and imports.
Data Types: To me (and I think most Javascript converts), we’re used to everything being an object. The Elixir/Erlang data types are many and, at times, maddening. When to use a tuple, a map, a list, a struct, and atom? Why use an atom and not a string? And the various notations, e.g. %{“a” => :b} vs %{a: :b} //error.
Macros: Marcos often hide the code (to me anyway) and makes it difficult to determine if you’re dealing with a function, macro, or what. They can be very magical and very frustrating.
Imports: I still fight this one. I’ve never worked with a compiled language. With Javascript being interpreted (and the Common JS / ES6 import pattern), Javascript imports are explicit. Elixir’s use
macro can inject functions. And use of named modules doesn’t tell you where the function physically sits.
But I’ve done more in two months with Elixir than a year of Node. I find the code so much easier to read (save the imports parts) and explicit.