Which books do you recommend for someone new to functional programming and Elixir?

Hi there,

I’m interested in using Elixir because of the rumors about the reliability of the Phoenix framework, and surprisingly, Elixir’s syntax is similar to my favorite language, Ruby. I want to ask, are there any good books to learn this language? Please start from the easy level first, because I have never programmed using the functional paradigm.

I am sure others will chime in with books but I just wanted to say that Elixir can be surprisingly approachable to start with so I’d urge you to go through the official introduction before reading any books.

6 Likes

Elixir in Action is great book for learning basics and it also starts into more advanced territory. You can check more on this post.

1 Like

Learn Functional Programming with Elixir is probably what you’re looking for:

However, it’s only an introduction. You’ll need to complement your knowledge with other resources after reading it.

4 Likes

Yeah, as @Cruz says, “Learn Functional Programming with Elixir” is almost certainly your best bet, as there is a strong focus on the way things are done in functional languages, which I suspect will be important to help reorient yourself to that way of thinking. That was certainly the hardest part of the journey for me, but everything just makes a lot of sense once you “click” with it.

Both “Elixir in Action” and “Phoenix in Action” are a few years old now but cover a lot of what you’ll want/need to know. They were the first books I picked on the subjects, back when they were in Early Access, probably five years or more ago.

I also thought reading the rather old, but still very informative “The Little Elixir and OTP Guidebook” was time well spent, as BEAM/OTP are so key to the reliability and general loveliness of working in this ecosystem, and it’s super important to get a good grasp of them fairly early on. I originally found a dodgy PDF of the Early Access version on t’Internets, but I felt guilty, plus it was full of errors, so once I’d realised it was worth reading, I grabbed a second hand copy which cost me just over 10 GBP delivered.

Humble Bundle recently had an e-book bundle of Pragmatic books for the Elixir ecosystem, which included “Learn Functional…”, but that’s now finished. It’s a bit of a mixed bag, but there are some great e-books in there, for very little money, so it might be worth keeping half an eye out to see if they run that again.

All that said, the docs for Elixir, Phoenix, and most of the ecosystem really are exceptional, and much higher quality that pretty much everything else I’ve used, with plenty of examples, tutorials, and a uniform presentation, which makes them a joy to navigate, and the importance of that should never be underestimated. Once you get going, the interactive help embedded in IEx can be super helpful too.

My advice is, avoid learning functional programming as something separate from the language

Each language is different, Elixir, Clojure, F#, Rescript, they are all functional but different

Just focus on learning Elixir, and try to avoid comparing it to other language you know , i.e. dont be a critical learner, take it for what it is (at least at first)

Also focus on learning the eco system, Ecto, Phoenix etc …

People debate about what functional programming is all the time, and different languages implement it differently , note for example that Elixir and Clojure are both Dynamic languages, F# and Rescript are typed and form the ML family of language, so while they are all functional, while in F# or Rescript, you will be programming with types (Functional Types) , and it only get more complex from here since Elixir is moving to add more type checking , so I cant really tell how best practices for Elixir will become a couple of year from now, so to cut it short, just learn Elixir … and AVOID books, that teaches functional programming along side Elixir, they will most likely teach you one very biased perspective of functional programming

If you are not a beginner Dave Thomas book is good, its seems to “cut it to chase” and doesn’t waste your time

3 Likes