Would you still pick Elixir in 2021? #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, we have created several beginner friendly tutorials that take you from zero to fully functional App:
The text was updated successfully, but these errors were encountered:
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 as much value in adding Clojure to that stack versus something that doesn't run on JVM. 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 !
Elixir RAM and the Template of Doom: https://www.evanmiller.org/elixir-ram-and-the-template-of-doom.html (or "Why Elixir is So Much Faster at rendering templates than other languages)
This is a good post on the topic of “Why Elixir?”:
I'd just like to add the StackOverflow survey for 2019, which states that Elixir is among the top 25 most popular languages, the 8th most loved language and the 5th language when it comes to salaries (which, I doubt could be attributed to the scarcity when it comes to the number of devs now). Just my 2 cents.
@nikunjy out of curiosity, how did you discover this thread?
You are clearly a very competent/accomplished developer and you mean well by your comment,
Many Good Frameworks/Libraries vs. One Great Framework
It's remarkable how the
Phoenix really delivers on the promise of "productivity". We have seen complete beginners start contributing to a Phoenix project within a day of learning with no prior
I would counter-argue that having too many frameworks/libraries causes confusion and indecision. In
How Many Packages is "Enough"?
In both cases these ecosystems have way too many packages which leads to decision fatigue.
It is not about number of packages. It almost doesn't matter if Go has 2 million packages that only shows that people are excited about writing golang.
I am talking about packages:
JS, Go, Java.. have both kinds of packages. Pick any SaaS provider they almost invariably write libraries for those languages supported.
For most of open sourced technologies you will observe that there thousands of followers and users of a repository. This leads to a very high number of issues being opened and talked about and in turn leads to a robust library.
GIthub followers, Slack channels, even Reddit :D
You guys, are all experienced developers, have other languages in the past, and years of work. It's easy for you to switch to any new stack and find a job with it. Like Elixir/Phoenix.
But let's consider the backside of it. We see a lot of JS, Ruby, PHP (etc) junior vacancies, and almost ZERO of them for Elixir stack. Every "Elixir" company demands a senior developer. That is a real obstacle to make Elixir popular. Only a few experienced developers decide to change the stack at the peak of their experience and try Elixir. When a lot of beginners even don't try because of a lack of junior positions around.
Even me, with 5 years of Ruby experience and zero at Elixir, can't find an Elixir job outside of the US. They all say "come later, after at least a year of real work".
So, probably the companies, who adopted the stack, should reconsider this practice if they want to have more Elixir developers in the future :)
Would be nice to public such vacancies somewhere if they exist.
@Shoroh the "beginners" perspective is the one we most consider.
Yes, the people in this thread have - for the most part - used several programming languages which gives us a basis for comparison between them. It means we have surveyed more languages and concluded that
We hear you.
The Upside of the Post-pandemic World > Remote Working is Mainstream
The tragedy of both direct and indirect suffering as a result of the Covid19 Pandemic should not be understated.
For those of us who don't live in a major Technology Hub (San Fransisco / Silicon Valley, New York, London, Paris, Berlin, Shenzhen, Tokyo, etc.) it opens up considerably more options for companies we can apply to work for because they already acclimated to remote working.
The potential downside of more companies doing remote work is the potential for a "race to the bottom".
@elgalu thank you for your interest in this thread and for sharing this misleading graph.
I can't tell if you're just trolling or if you are genuinely interested in understanding the reason why there are fewer
If you really wanted to show a contrast, why not compare it to
Everything else seems pretty "flat" when compared to
And what about the most popular programming language in the world by far,
What happened in 2016? Did the popularity of
As a "Senior Machine Learning Platform Engineer" you must know quite a lot about statistical models.
A Single Graph Doesn't Tell The Whole Story
The Google Trends graph for
What can we infer from this data?
If someone just pasted the Google Trends graph, people could think that the situation is "under control", right?
The point is the Google Trend graph doesn't represent the grim reality,
StackOverflow is Not Where People in the
Wow. I'm impressed that this thread is still going. I started learning Elixir in 2018 and, having a history of being both a Ruby / Rails dev and a JS dev ( React, Angular ) I thought that Elixir and Phoenix would be the new hotness and a fertile land of opportunity and bliss.
I do think that Elixir is bliss. Although the learning curve is fairly steep, the rewards of functional patterns , pipes, and the simplicity of thinking, the promise of everything the underlying Erlang ecosystem offers, all of that make it a wonderful language to work with.
However, in 2021, there are some glaring issues that have already been stated throughout this thread.
The first issue is community.
The second issue is Phoenix itself. Of the people I've talked to, Rails beats Phoenix hands down in terms of developer experience. And nothing beats ActiveRecord in terms of the dev experience. This leads to a larger issue.... most everything about Elixir is better and more efficient than Ruby, and most everything about Ecto is more efficient than Active Record, but Active Record and Ruby are 10 times easier to use.
There's something to be said for frameworks and languages that are intuitive and user friendly. Elixir, Phoenix, Ecto are precision tools that are somewhat isolated due to the steep learning curve. Of course, you don't have to use Phoenix if you're using Elixir. But for me, I like to be able to harness the power of frameworks because I don't like to re-invent the wheel when I'm building something.
The way I feel is that if I needed to build a fault tolerant, fast, bullet proof back end for something like a social media platform, and I were developing it and maintain it personally with a few trusted comrades, I would choose Elixir and Phoenix. But if I wanted to build my career on a language and framework that has a large, vibrant community, tons of open source resources, ability to find answers on StackOverflow, etc. etc. ... I would stay far away from it.
IMO Elixir is the tool you want to use to build YOUR business, your company, your software, assuming that you can groom the in-house talent and keep your applications going with your own efforts or a tightly knit team that you are managing. It may also be a good tool if you want to find something to build an expertise in that will get you into a few niche markets.
But if you want to learn a language to build your marketability as a dev to build apps for other people, it's a good choice but its popularity is waning, and you may find that the time invested in Elixir may not be the best investment if you don't have a personal passion for the language and a personal /business use for it yourself.
Highly subjective opinion, I know. Open to pushback and feedback.
What is your basis for this assertion? Elixir broke into the top 50 languages of the Tiobe index for the first time this Feb and has maintained it for a second month. I'm not saying it's going to skyrocket through the ranks, but it appears that the popularity isn't exactly waning.
I feel if we are strictly comparing Elixir with Ruby it ends up with a bit of apples to oranges comparison.
Although Elixir has some syntactic sugar to make its syntax pleasant or ruby-like but that's where the similarity ends. Its still all Erlang and BEAM under the hood which is a completely different language and runtime with its own niche which is soft real time systems and easy multicore concurrency. Language wise, Elixir being a functional programming language will also have a different way of doing the same things in a more functional manner as compared to Ruby which is purely object-oriented. On the learning curve, I have seen instances of companies where developers got productive enough to write production quality code in Elixir within 3 weeks with no prior experience with it.
But the goal was not only to provide a faster alternative for Ruby/Rails or web developers in general but also a more developer friendly way to utilize a more efficient runtime (BEAM) which can be used to solve a host of different other problems.
All these said, I don't think practically Elixir will have the similar number crunching performance as compiled languages (unless we are making use of NIFs) but that's not what Erlang was designed for anyways and in the end it all boils down to using the right tools for solving the right problems.
" This is just one data point but I think it's at least as strong as your Tiobe data point, Elixir was dropped from the yearly Stackoverflow survey due to too little usage " ..... Precisely.…
On Tue, Apr 20, 2021 at 5:05 PM Joel ***@***.***> wrote: @ed-chung <https://github.com/ed-chung> This is just one data point but I think it's at least as strong as your Tiobe data point, Elixir was dropped from the yearly Stackoverflow survey due to too little usage https://insights.stackoverflow.com/survey/2020/#most-popular-technologies, while it was there one year before https://insights.stackoverflow.com/survey/2019/#most-popular-technologies. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#102 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAHBTL442HAVAM2EK5BS6FLTJWCZFANCNFSM4GI6353A> .