5 ms·
I learned ruby on a big project about...5 years ago. I've been using it ever since at work and I definitely understand the pain points. With Ruby you really hav
by brightball 9y ago
I learned ruby on a big project about...5 years ago. I've been using it ever since at work and I definitely understand the pain points. With Ruby you really have to learn to understand and appreciate where its strengths are to be productive with it (how close it can bring you to Aspect Orient Programming is probably the biggest).
The only similarity that Elixir honestly has with Ruby is clean syntax and general emphasis on productivity. Everything else is different. Same with Phoenix. On the web side of things it has routes, controllers and views...but there's no magic involved. It's all very clear, explicit and flexible in how it does things. The view layer is honestly one of it's biggest strong points because the way it's handled is the core reason for all of those "My site was faster without caching" articles...but you don't have to work differently to enjoy those gains.
Big Nerd Ranch did a solid write up on the ins and outs of why.
https://www.bignerdranch.com/blog/elixir-and-io-lists-part-2-io-lists-in-phoenix/ https://www.bignerdranch.com/blog/elixir-and-io-lists-part-2...
This Choosing Elixir for the Code post that came out last month does a really good job of emphasizing a lot of it.
https://pragtob.wordpress.com/2017/07/26/choosing-elixir-for-the-code-not-the-performance/ https://pragtob.wordpress.com/2017/07/26/choosing-elixir-for...
- tmat 9y agoPhoenix is completely unnecessary though. I have gone away from it and just use good old Plug and Elixir. Works amazing for me.
- brightball 9y agoDifferent strokes. One of the big Phoenix perks is that using it instead of just raw Plug has very little performance drop off. It's not a Rails vs Sinatra situation. The Phoenix Channels implementation for websockets and the view layer for web requests are pretty phenomenal IMHO.
- novembermike 9y agoIsn't Phoenix just Plug + Ecto + generators and a folder structure? I always saw it as "how to use Plugs" rather than a separate project.
- gamache 9y agoThere are some unique bits too. Phoenix Channels is a beautiful, shit-simple pub/sub abstraction on WebSockets and provides both JS and Elixir libraries. And then came Phoenix Presence, which can track shared state (like a user's online status) in a durable and fault-tolerant way. Both are useful libraries, but the fact that they work in server clusters as well as single-node deployments is the real kicker. That's just how Erlang rolls.
- tmat 9y agoThat's just genservers though right? All of this stuff is just Elixir and generally can be done in Elixir in a few lines of code. We're experimenting with a truly OTP driven web application right now(No API) where we connect the React app directly to the Elixir backend and only persist to a database on log out. Everything else is persisted in memory and run through genservers which are self healing and self hydrating.
- gamache 9y agoPretty much anything of value in the Elixir ecosystem is "just" genservers. OTP remains the star of the show.