Join GitHub today
Would you still pick Elixir in 2019? #102
A friend of dwyl asked the following question in our "chat" system:
We feel it's worth capturing the reply in public because it's relevant to anyone considering Elixir.
Let's give the question a bit of context first:
Which Programming Language Should We Use... ?
The question of "Which Programming Language" is one we ask ourselves fairly regularly, and is the reason that lead us to discover and decide on using
A good place to look for the trends is in the "Most Wanted" list of the StackOverflow Survey:
Not that you should allow yourself to be "lead" by the crowd, but it's useful know the pulse of the wider developer community, especially when trying to make the case for a new language at "work" or deciding what to learn for yourself.
At the time we (our entire team/company/community) were deciding what to learn/use next
Our reasoning for "jumping ship" from Node.js to Elixir can be summarised by the following list:
I don't like to think of @dwyl as having "competitors", but if I did, I would want them to use JS/Node.
Our "medium term" plan @dwyl is to build IoT devices to control our home https://github.com/dwyl/home
Along the way we are building a distributed/decentralised learning platform that will heavily feature real-time interaction. Again, Elixir is perfect for this; nothing else comes close!
We have built several "CRUD" and "REST API + Elm Frontend" apps for clients over the past 2 years and I can honestly say that I'm happy to maintain any one of those apps and I think anyone else "inheriting" the codebase will thank us for how the code is written, tested and documented.
Our "Real World" Experience
We have been using Elixir (almost exclusively) for the past 2 years for all our client and personal work.
Phoenix has been a joy to use for the projects we have worked on and because it's the de facto standard in the Elixir community, I'm confident that any code we have written is maintainable by anyone else with Phoenix experience. i.e. it's easy to "onboard" people into a Phoenix project because everything is where you expect it to be.
We are very pleased with the development in the Phoenix framework over the past few years
When new versions of Phoenix have been released the upgrade process has been painless.
I have zero regrets in adopting elixir for our client work and my personal projects.
Use Case: REST API ... ?
A REST API is something you generally build for other people (developers/companies) to "consume". (unless you are building "microservices" for internal consumption ... useful to clarify!)
If your use case is a simple REST API, I would recommend you just use what you (already) know.
In many situations, the choice of programming language is less important than the "deployment" of the resulting application. If work somewhere "traditional" where the "DevOps" people are not ready to support an Elixir App, then the question of "which programming language" is moot.
The biggest question anyone considering Elixir needs to ask is: do other people in my team/company want to try something different? i.e. will "Negative Nancy" shoot it down? and will "DevOps" support it?
If you are lucky enough to work somewhere that is open minded about tech, find a way to show your "boss" or peers that Elixir is an excellent choice for anything "real time" and "high reliability".
These are the languages I would recommend to anyone in the OP's position in order:
If you are reading this wondering what to do/learn next ...
Practical reasons why Elixir is a great choice:
Great write-up! The jobs thing might not be as dire as is looks though:
The only point I would really disagree with is the list of suggested languages.
When you talk about other choices being "considerably more difficult to learn", this definitely applies to Rust too. Of the various modern languages I have spent more than a few months with, I would say Rust is easily the ugliest. That said, I can't argue with the performance it offers and I would still add it to the list to fill a hole in their current skill set.
When the OP already knows Java and Scala, I don't see any value in adding Clojure to that stack. Go I simply don't see offering enough unique advantages, and Haskell is a 'nice to learn' for purely academic reasons but I am yet to come across a scenario where I would ever choose Haskell over Elixir. It's just not as practical, accessible or just plan fun to work with.
If I had to suggest a list, it would be:
and as a distant extra, possibly Elm.
Well unless you want async (CSP), STM, lazy sequences and other features of Clojure that people love. I only know Scala devs who gave up on Scala because it is overly complicated and generally not worth the effort to learn. Clojure can be learn in few hours.
Not a dig against Elixir, I'm just surprised to not see much mention of Ruby here. Ruby may not have the same functional basis (something I like about Elixir a lot) but many of the pros throughout this thread apply to Ruby as well. In fact if I'm not mistaken Ruby was influential on Elixir's syntax. I've even heard Elixir described as "Erlang with Ruby syntax", even though I know that's not technically correct obviously.
Edit: I work with both Elixir and Ruby. I can say I personally like Rails more than Phoenix in many ways. Though it's mostly my love of ActiveRecord. I also still feel like it's easier to get Ruby to do what I want it to do (often described as a con), since it's so flexible. E.g. I can rip open the
@nixpulvis good point.
All of the "lessons learned" from
I used Rails a lot back in the day and found that it had way too much "magic" and arbitrarily named modules full of "inside jokes" that made it less beginner friendly ... Elixir still has some of that due to the overlap in communities but the code is much easier to follow through the stack.
Anyone following along this thread who has not experienced Ruby, see:
To be clear I'm not "picking" on Ruby, it's still "good".
and you wouldn't use it for your life-support system for your grandmother.
Still, it's definitely "one to watch".
Many people treat their programming skills as "work" and don't do any learning in their "off time".
If I was only allowed to pick one language to write in 2019 I would pick Elixir hands down all day long.
This isn't really true anymore, and hasn't been for some time. Rust hit "stable" release a while ago, and has committed to avoiding breaking changes going forward as much as possible, at least within editions. I've been maintaining a small Rust tool since very nearly 1.0 and have yet to have to change anything for compatibility reasons.
I would say though that this is less true still of much of the web ecosystem unfortunately, especially as my favorite choice of framework, Rocket, still requires nightly (though this is changing soon!). Perhaps this is what you mean by this?
@jarcane thanks for clarifying. I haven't played with
I picked Elixir in 2015 with Dave Tomas's Book, i had faith it is destined to be the new framework that will replace the flawed breaking MVC Pathways of rails, but meh.. that didn't happen. Since then i have moved to Clojure and found better and more composable ways to write code, with both very large and small companies both backing it. Clojure is destined to touch greatness in the long run. Elixir maybe not so.
Dave Thomas' Book "Programming Elixir ≥ 1.6" https://www.amazon.com/gp/product/B07DP8Y2GJ/
We have tried to make our notes in this repo beginner-friendly https://github.com/dwyl/learn-elixir
I would urge anyone else reading this thread in 2019 to consider
Ultimately, if people pick Clojure over Elixir that's cool.
“Indeed, the ratio of time spent reading versus writing is well over 10 to 1.
True, but you should also give Elixir a try. It's very nice
I've had a lot of success in selling Elixir to my current employer which is primarily a Ruby shop. I'm not really afraid of ugly syntax like some claim Erlang's to be, but some people are, and though that thinking to some may seem flawed, it's still a valid concern from the perspective of a project owner or chief technical role. Elixir's syntax helps alleviate those fears, and combined with its benchmarks, I've really found that it's not a tough sell.
If you use TypeScript it's more easy. Also newest node adds
Crashes are extremely rare in node (and restarts on crashes are handled by deployment platforms) plus unhandled exceptions can be catched with
It is far better than using prototypes back in the days and plays well with typescript. Classes don't need to be used as entities that encourage mutability, they can be used as simple typed containers of data, that also allow mutations if performance requires it (no copying). Matter of opinion.
Corporations like Microsoft, Google, AirBnb, Uber, Netflix are also prominent in JS ecosystem. For me personally it's not a problem, even it's an advantage because I know they have resources to support libraries and tools they've created practically forever.
Don't get me wrong I really like Elixir and would love to use it instead of Ruby if it had mature enough package ecosystem. While it's great choice for API and servers, it's not replacement for Node (at least for web apps, you can't make universal app in it, see Next.js). I think this post could rather pick "Why Not Stick with Ruby?" topic instead.
I couldn't help myself. This thing is very well written.
I'm just starting out with Elixir and the official tutorial is very good apart from the fact that starting from GenServer stuff it had too much "how" and not enough "why" to the point of me forgetting why I wanted Elixir in the first place. Finding this very well written topic made me remember :) so thanks @nelsonic ;)
Hmm, I'm using Next.js and I prefer keeping front and back codebases separate anyway. My goal is to use Next.js in front and elixir in the back. I'm only starting with elixir, but can't really see why I can't write a full blown webserver with elixir. I do find myself thinking in the old mindset - maybe this is also why you think Node can't be replaced? The main thing I love about Node is the plain simple JSON support, but not exactly a show stopper.
Just to point out that while this comment HN is absolutely right, sometimes we need a personal experience (just like sometimes we need an opinionated framework) more than an in depth analysis.
As defined by https://developers.google.com/web/progressive-web-apps/
I never said you can't have both. I said that Elixir is not replacement for Node for web apps because of SSR, it can be only be used instead of Node when Node is used to serve API requests which is rarely the case: nowadays Node is mainly used for 1. writing universal libraries 2. writing apps and bundling them with webpack/parcel/etc for different targets like browsers or native apps
I have been using it for quite some time and prior to that Erlang as well. :)
On Jan 7, 2019, at 10:17, Istvan ***@***.***> wrote: When the OP already knows Java and Scala, I don't see any value in adding Clojure to that stack. Well unless you want async (CSP), STM, lazy sequences and other features of Clojure that people love. I only know Scala devs who gave up on Scala because it is overly complicated and generally not worth the effort to learn. Clojure can be learn in few hours. True, but you should also give Elixir a try. It's very nice I have been using it for quite some time and prior to that Erlang as well. :) — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
LOL. I must say that since I've gotten into Elixir I haven't had this much fun programming since learning Ruby. The two are simply a joy to use but Elixir is quickly becoming even more fun.
Additionally, I saw the ExUnit "dynamic" comments last week for the first time ( where the tests will fail if the examples in the comments are out of place!!! ) and I almost felt like I was in church. Hallelujah !