I worked through the first six chapters of Elixir in Action (Third Edition), ans so far absolutely like the book. The first four chapters are about the language, and chapters five and six are about concurrency primitives and generic server processes.
However, starting with chapter 7, the book is mostly about OTP, which is a bit overwhelming at the beginning.
Now my goal is to write some PostgreSQL-backed CRUD applications providing a REST API. How much of OTP am I required to master until I can seriously start working with Phoenix and Ecto?
I’d argue after the chapters you’ve gone through you’re fine digging into phoenix and ecto. I’d however suggest not dropping the book. Even if things might go over your head right now there will come the place where having read about those things will become something you need.
Personally, I would read at least chapters 7-10, it’s not as hard at it might seem, and explains important concepts.
You could probably start writing Phoenix apps right aways with your current knowledge (plus asking your favorite LLM to explain certain aspects from time to time), but having the right understanding of fundamentals is very very useful in the long term.
You can also just skip the hard parts and continue reading; the things will get progressively easier once you revisit the book after some real experience with the language.
Thanks for the answers. So a reasonable compromise would be to give chapters 7-10 a quick read, start working with Phoenix and Ecto, and then coming back to those chapters for a deeper read.
From my own personal experience, you do not need to learn OTP, processes, GenServers, etc to get started with Phoenix.
What’s nice is that Phoenix and Ecto both use OTP and processes under the hood. So you’re getting a good amount of concurrency and fault tolerance for free. For example, every HTTP request to Phoenix already spawns a process to handle that request.
A common mistake for beginners in Elixir is to use GenServers when plain Elixir will get the job done.
I agree with the general sentiment in this thread.. just finish the book - it will be well worth it
If you get overwhelmed when reading a chapter don’t be afraid to restart it/take a step back. Whenever I read a book I have a general rule that I make sure I understand everything as I am going and I do not proceed unless what I’ve read makes sense. If it doesn’t, I will re-read it or restart the chapter or even quickly skim through what I have read in the whole book just in case I forgot something. Most good books will usually build upon prior chapters ensuring you know everything needed to tackle what’s next in the book.
You might also want to read it concurrently with Programming Elixir - when I read them I felt they both complemented each other very well.
Since I don’t understand hard stuff on the first reading, I always read a chapter once quickly and once thoroughly. If I still don’t understand it, I let it rest, do some other things in that field, and come back to it later on. So I’d rather start working with Phoenix in parallel to working through those OTP-heavy chapters.