patrickbucher

patrickbucher

How much "Elixir in Action" (i.e. OTP) to get started with Phoenix?

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?

First 6 of 6 Posts Switch mode

LostKobrakai

LostKobrakai

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.

vkryukov

vkryukov

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.

patrickbucher

patrickbucher OP

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.

venkatd

venkatd

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.

AstonJ

AstonJ

I agree with the general sentiment in this thread.. just finish the book - it will be well worth it :icon_biggrin:

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.

The tips on my blog might also help:

patrickbucher

patrickbucher OP

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.

— All posts loaded —

Where Next?

Trending in Chat/Questions Top

krisleech
Hey folks, I’ve been using Elixir for over a couple of years (phx, ecto, broadway, oban). For this kind of work you do not tend, in my e...
New
mhindujadheerajsudan
Hi, I’m Dheeraj Sudan from the UK. I’m a software developer and also run a business with my wife Meenu Hinduja. I’m interested in getting...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New

We're in Beta

About us Mission Statement