What I have to say about Elixir pro/con
Here I am after… what? 2 years? of almost exclusively using Elixir. Maybe more? It’s hard to keep track of when we retired other programming languages for good.
I was the driving force behind going full on Elixir, and I am ready to take to full blame for everything that goes wrong in our apps. But I am feeling pretty good - most of our problems come from server issues (except for one memory leak we could not pin down yet…)
But here is the story.
Along comes Rails… You just need to google what helpers to use, and stuff works!
I had to learn EmberJS - which is kind of Rails for frontends, probably emerged a year or more after the first real frontend JS frameworks became popular. And I ran into the same problem… “but what if I want to do something not in your text-book, that seems to be written in Web 1.0 times?”
And additionally, we had to maintain the Rails API server (written before
rails_api was a thing, so we had to manually remove gems), and the EmberJS frontend.
My predecessor started fooling around with Elixir early on, and we had one actually very important app running on Phoenix pre 1.0 and Elixir (beta version?)
At first I hated Elixir… I did not understand how to use it, given my Ruby on Rails background, and basically used to things just happening magically.
And then I had to actually use Elixir. And I realized that everything was so much more explicit.
Want to know where something comes from? Do a project wide search for
something and you see everything where it’s passed down to the view etc., instead of being some magic shoot you can never find if you don’t know how Rails works.
But the real kicker for me was when Phoenix made the switch from the MVC style to Domain Driven Design. I read the blog post (help me out here, probably by Chris McCord?) about how DDD works in Phoenix and I immediately thought “this is so much better than RoR!” I went throught the redesign for Phoenix with Elixir, and I am just in love with the barebone design of the language. But it also has all those web development packages, that follow the same design principle: as barebone as possible, if you want more, add dependencies.
I have updated Ruby, React, Ember, and Elixir server for years now, and I have to say Elixir is the easiest to update (except for the one error we run into every now and then with hackney! why tf does it actually prevent me from ignoring ssl for crappy APIs.)
So, for me personally the context focused Phoenix structure was the reason why I wanted to use Elixir more. But I can also attest for the performance and reliability.
We had a Elixir/Phoenix server running for almost 4 years before I first looked into it - and the reason I did was Heroku updating stuff, and we moved it to a cloud server. Almost no problems, super easy with edeliver (once you understand how it works, admittedly.) And another server I updated w/o understanding Elixir yet, also on a version that was probably still alpha, maybe beta. Updated the server and app, and all the errors were very descriptive and easy to understand. I would honestly say the hardest update in Elixir happened just recently, and it’s just because of hackney!
Another reason why to use Elixir: we recently had a few spikes from a customer who wanted to do a bulk interaction. A few thousand requests/minute + usual traffic. I saw the spike on the server, but no problems other than the database server sometimes crapping out.
- Lightweight stlib, once you know Elixir you know it (unlike Ruby, where they add aliases for methods every 3 monts)
- Once it is deployed, it will just run… and run… and run…
- Phoenix is a great web dev framework for intermediate developers
- NEW The language is still quite new, so sometimes you can implement packages for everyone. I have a package a few people use, and it feels very good to be part of the community.
- EXPLICIT Elixir/Phoenix values explicity over implicity, so unless you screw up, you always know what is going on.
- first deploy can be a pain the A**
- erlang is slow to install, and the community seems to be stuck in the 90s when you look at their docs
- NEW the language is still quite new - opens opportunities, but means you will have to implement stuff yourself where other languages have packages ready.
- EXPLICIT There is more code to type, more data to pass, and most things don’t just work magically.
I put 2 things in caps, because I think they can be a blessing or a curse, depending on how you look at it…
Overall Elixir, Phoenix, and especially PhoenixLiveView have changed the way how I do my poopy web apps, and gave me the feeling of finally having “one app” that does almost everything, instead of a bunch of “micro services” in Ruby/PHP/Python and a separate client.
Also, we developed an app in ReactNative - guess how hard it was to establish a websocket connection to the server from react native. Right, ridiculously easy.
So, why Elixir?
- I just love @chrismccord for Phoenix (great name, great technology!) and of course @josevalim for developing Elixir and still being active in the community!
- Because for me it is a modern take on an old, battle tested technology. Erlang syntax is a crime against humanity IMO - so thank you again Jose to make the technology actually usable.
- You can easily use Elixir w/o Phoenix or anything, and it’s still incredibly good in spawning lightweight processes all over the place (the orchestrator)
- honestly, I am just attached to this programming language/community now. And as long as I am in charge, we will keep using it! Keep up the great work!