3 ms·
I'm sorry you had such a hard time getting into Elixir. Dave Thomas's book on Elixir is a very good introduction and there are a few other Elixir books out ther
by dimgl 10y ago
I'm sorry you had such a hard time getting into Elixir. Dave Thomas's book on Elixir is a very good introduction and there are a few other Elixir books out there that can get you started really quickly.
The issue really starts when you start writing web servers. I always advise that anyone who wants to start using Phoenix learns how to use Plug first. Phoenix is very macro heavy which can give that magic-is-happening feeling when you run your app, but looking through the Phoenix source code and using Plug is a great way of getting your head around what is actually happening behind the scenes.
Elixir is incredibly powerful and I find myself being more productive with it than with most other languages. TDD and integration testing is also surprisingly easy.
- rubiquity 10y ago+1 to learning Plug before Phoenix, too. Sometimes I feel like I have god mode activated when co-workers or friends are hung up on the connection life cycle or not sure how a piece of Phoenix works/scales. I'd add a basic understanding of OTP to that list as well. Phoenix does do an excellent job of getting people to try Elixir, kind of like how Rails did for Ruby. Phoenix has also added a cool abstraction in Presence/CRDTs. Now that people don't have to implement that themselves I wonder if that will be as useful to people like how ORMs stormed onto the scenes in the early 2000s.
- carlesfe 10y agoAuthor here, I definitely agree. I tried to learn Phoenix just after Elixir, and I just couldn't do it. Now I've written a couple of simple web apps with Plug, and realized that I don't need Phoenix for most of my use cases.
- goldbrick 10y agoWould you say that Plug is the Rack of Elixir?
- rubiquity 10y agoYes that's exactly the domain that Plug sits in. It's an interface from web servers to applications. As someone who tinkered around with Rack and Ruby web servers a lot, Plug is much better designed (yay for learning from past implementations).
- alxndr 10y agoI'd even say that Phoenix is more akin to Sinatra than to Rails.
- carlesfe 10y agoI'm sorry if it looked like I had a hard time. It wasn't hard, just long. I consider writing production code of a new language with a different paradigm in just two weeks a success! I agree with web servers, check my reply below. Plug + Router is enough for most things, and even though everybody recommends Phoenix (maybe because many want to move from Rails to Phoenix?) I found it too complicated since I've never used an MVP framework, I'm more of a devops guy. Finally, I didn't mention Elixir tests, but they are great. The lack of mutable objects helps a great deal too
- di4na 10y agoInteresting, i think there is a telk to have here. Because Phoenix is not Rail. No part is forced. Everything is modular. Maybe there is a need to put an emphasis on that more on the main guides. Because in the end, the only "mandatory" part of Phoenix are Cowboy, an Endpoint. And that is all. If you use Channels only, you do not need a Router.