New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would you still pick Elixir in 2019? #102

Open
nelsonic opened this Issue Dec 7, 2018 · 24 comments

Comments

Projects
None yet
@nelsonic
Copy link
Member

nelsonic commented Dec 7, 2018

A friend of dwyl asked the following question in our "chat" system:

question-using-elixir-rest-api

We feel it's worth capturing the reply in public because it's relevant to anyone considering Elixir.

"Hi guys, sorry for bothering, but I need your help/input with something
I know that you have been working with Elixir now for a while
So I want to ask you guys on your thoughts about it now after doing some real work with it
The pro's, the con's
would you use it for rest api etc"

Let's give the question a bit of context first:

The OP asking the question is a talented/experienced programmer who has worked as a programmer for 10+ years and already knows JavaScript, Java, Scala, Elixir (a basic app including GitHub OAuth). They are a "senior engineer" at their current day job and make a good living by both national and international standards. However from speaking to them extensively they don't enjoy their Job.
(this last part might not be relevant so you can ignore it, but just to say they do not work for @dwyl ... despite our best efforts to offer them a job!)

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 Elixir in 2016. We periodically survey the "up-and-coming" languages like Kotlin, Julia, Lua, etc. and keep concluding that our choice of Elixir is the one we would make again right now. Elixir is the "full package" from idea to deployment!

A good place to look for the trends is in the "Most Wanted" list of the StackOverflow Survey:
https://insights.stackoverflow.com/survey/2018
Sadly, for some reason SO decided to exclude Elixir from their list this year! But the last time they "allowed" it as one of the options is came out near the top:
image

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.

Why Not Stick with JavaScript/Node.js?

At the time we (our entire team/company/community) were deciding what to learn/use next
were all proficient in JavaScript/Node.js and had built many projects using the "Old Stack".

Our reasoning for "jumping ship" from Node.js to Elixir can be summarised by the following list:

  • Node.js Error Handling 😢 ... if you've ever had to debug a production bug in Node.js you will know what I'm talking about. On large Node.js projects finding the source of a bug is an expedition! And since Node is a single-threaded event loop, if the process crashes for one user, it crashes for all the requests being handled by that process. i.e. one user can crash the server for hundreds/thousands of people! This is a terrible design flaw (that I used to think was a "feature"...) it's "OK" on AWS Lambda where every request spawns a new process, but most Node.js is not being run on Lambda!
  • JavaScript Fatigue 😫 there is a new library/framework vying for attention every week! it's exhausting! As a developer I just want to get on with my work, not have to read another Hackernoon post on how everything from last week is obsolete because XYZ framework "changes everything" (for no good reason!). Note: I love learning new things. just not re-learning in the same thing each time there is a "new" way of re-writing a function! JS did not need class. It's a horrible interface!
    see: https://medium.com/@Rewieer/javascript-the-bad-parts-and-how-to-avoid-them-1a7c9bc5a0dd
  • Everyone thinks they can write JS code, few take the time to learn how to write maintainable JS.
  • Facebook trying to "own" the JS ecosystem ... 😡
    • The "State of JS" https://stateofjs.com is created/maintained by people who use Fb's JS "stack".
      They are all heavily biased toward React, GraphQL, etc. and as a result they are further perpetuating the use of these tools.

I don't like to think of @dwyl as having "competitors", but if I did, I would want them to use JS/Node.
Because it's an inferior experience to Elixir in every meaningful way.

Why Elixir?

Our "medium term" plan @dwyl is to build IoT devices to control our home https://github.com/dwyl/home
for this Elixir is perfect there literally is no better platform for IoT than https://nerves-project.org

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.

Pros

  • Elixir is easy and fast to learn. Most people can achieve proficiency in less than a week (focussed).
  • The language is beautifully designed for readability by one super smart "BDFL" who does "real work"; not just work in academia dreaming up esoteric language constructs. There are no "Norman Doors" in Elixir.
  • Elixir Macros are a super slick way of encapsulating and re-using functionality.
    Every good language has Macros.
  • Testing code is much nicer in Elixir than anything else. ExUnit is "baked in" and Property-based Testing is easy see: #93 This makes "real life" of a developer much better because writing tests is faster and the QA/PO can have high confidence in the code!
  • BEAM is an incredible VM that runs seamlessly on any hardware/infrastructure.
  • Error handling when things "break" is second to none. I would want my life support system to be built with Elixir. I intend to control my house, food and water with Elixir!
  • There are many awesome projects in the ecosystem: https://github.com/h4cc/awesome-elixir which makes it easy to get "inspiration" and find solutions to common problems.
  • People are using Elixir for Blockchain/Smart Contract apps and even Machine Learning.
    see: https://github.com/mana-ethereum/ethereumex and https://github.com/fredwu/simple_bayes
  • Elixir is "coming soon" to AWS Lambda: dwyl/learn-aws-lambda#112 when this happens there will no longer be any reason for us to use Node.js I cannot wait!

Our "Real World" Experience

We have been using Elixir (almost exclusively) for the past 2 years for all our client and personal work.
I can say categorically that I prefer to write, read and maintain Elixir 10x more than any other language.
I return to Elixir code I wrote 18 months ago and I can immediately understand it and I don't feel the need to re-write any of it because it "just works".

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
and Phoenix LiveView is going to be absolutely game changing! see: dwyl/technology-stack#68

When new versions of Phoenix have been released the upgrade process has been painless.
see: dwyl/learn-phoenix-framework#118
The attention to detail in the Phoenix changelog / release notes makes it easy to upgrade.

I have zero regrets in adopting elixir for our client work and my personal projects.
If anything I wish I could go back in time and tell my 2012-self to "drop" Node.js sooner!
I regret trying to use a spoon to dig a swimming pool; pick the "right" tool and let the BEAM do the work!!

"Cons"?

  • No "native" type for JSON data. You always have to parse JSON into a Map and there are excellent libraries for doing this. This is "fine" because it's fast, but I would prefer it if JSON was natively supported in Elixir so that I could copy-paste JSON data from JS-land directly into code/tests and just run it.
  • Relatively difficult to "recruit" developers with existing experience in Elixir (compared to Java/JS)
    This is rapidly disappearing as a "reason" to not adopt Elixir. The community is growing fast and there are even people on "Upwork" who list Elixir as experience/preference.
  • Management (at "big" companies) who don't (want to) understand functional programming or the concept of people enjoying their work, will never see the point of Elixir.
  • Fewer Jobs you can apply for as a Dev. This is just a fact you have to deal with.
    But if you prefer to work for open minded companies with good tech and learning culture,
    then Elixir is good filter/signal of a place you want to work.

There are hundreds of companies you can apply to work for.
see: elixir-companies and Jobs: http://plataformatec.com.br/elixir-radar/jobs
even McKinsey & Co are using Elixir!! (I got a DM from someone trying to recruit me...!)
Anywhere that uses Ruby is a strong candidate for Elixir. Expect the adoption of Elixir to accelerate in the next few years. Whenever you read a job for "Ruby-on-Rails" you can basically apply for it and ask them: "do you want to save 90% of your server costs, add real-time features to your app and transform your recruiting?"

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!)
The main goals of a REST API are to make it easy to understand and "consume" reliable to run.

If your use case is a simple REST API, I would recommend you just use what you (already) know.
If you know JS, use Express. If you know Java use light-rest-4j if you know PHP use Laravel. If already are familiar with Elixir, use maru it's lightweight and robust.

I feel the OP's_focus_ on "REST API" might not give us a full picture of what their end-goal is for the question ... are they re-writing an existing REST API to a new language/framework for better maintainability and performance? or create a brand new REST API from scratch?

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 work somewhere that does not have a kaizen learning culture, fuhgeddaboudit.

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".

Conclusion

These are the languages I would recommend to anyone in the OP's position in order:

  1. Elixir - because it's a "friendly" way to leverage all of the real-time power of BEAM. It has excellent tooling, property-based testing, deployment, monitoring and tracing.
  2. Rust - a close second to Elixir. Great for systems programming and building cross-platform apps, but expect "breaking changes" as still being actively developed (whereas Elixir is far more "stable").
  3. Go - Is the choice if you need to "sell it" to a "Boss". The fact that it's "sponsored" by Google and has full support on App Engine, GCF, and now AWS Lambda are major plusses. We don't use it because it's more verbose than Elixir, is more difficult to write real-time code and has an imperative programming style, which we find leads to more complexity.
  4. Haskell - The obvious choice if "purity" of your functions is a high consideration, but nowhere near as "fast" as Elixir and considerably more difficult to learn. Most companies are "afraid" of Haskell. The ones who have embraced it wouldn't use anything else!
  5. Clojure - If you work somewhere with a lot of JVM code, this will be easiest to adopt.
  6. Python - if you don't care about the infrastructure/server costs and just want an "easy life" as a developer. e.g. you don't need anything "real time" and just want RESTful "CRUD", use Django on Google Cloud: https://cloud.google.com/python/django
  7. Are you still reading this? Start learning Elixir!!

Next?

If you are reading this wondering what to do/learn next ...

@nelsonic

This comment has been minimized.

Copy link
Member

nelsonic commented Dec 7, 2018

Practical reasons why Elixir is a great choice:

  • Pattern matching means you write less code and almost no "if" statements. code is more expressive and readable.
  • Pipeline operator means your code flows logically and there are is less "control flow" noise.
  • First-class Documentation with ExDoc and inline doc testing means code comments don't go "stale".
  • Ecto makes dealing with any kind of data a breeze, e.g. user input validation/sanitisation, etc.
  • Package management is excellent. Hex.pm is simpler, faster and easier to use than any other package manager we've used. Private packages can be loaded via Git.
  • Testing and testability is excellent. Coverage works well so it's easy to spot un-tested code.
  • Any feature you can think of has been implemented, google it and you'll find the solution.
    Seriously scroll through https://github.com/h4cc/awesome-elixir and be amazed!
  • Memory efficiency is much better than most other languages (with the exception of Rust, but Elixir is miles better at Error handling than Rust, which is a more practical feature IMO.) Lightweight BEAM processes are amazing.
  • iex (the interactive shell) is fast, has code completion and great error messages that teach you how to write better code!
  • Compilation is fast and incremental. Much faster than other compiled languages!
  • Zero Downtime "Hot" Deployment is really easy and fast. It's only a few lines of code to run an incremental release that automatically manages live connections! This is a feature people pay real money for! You get it for free in Elixir/Erlang!
@nathanchere

This comment has been minimized.

Copy link

nathanchere commented Jan 4, 2019

Great write-up! The jobs thing might not be as dire as is looks though:

Fewer Jobs you can apply for as a Dev. This is just a fact you have to deal with.
But if you prefer to work for open minded companies with good tech and learning culture,
then Elixir is good filter/signal of a place you want to work.

I can't remember exactly which it was in (I think it might have been this: https://www.youtube.com/watch?v=Tsg6V0UBlEw) but one of the sessions at Code Elixir 2018 in London was talking about the difference between the supply and demand of Elixir developers. The demand might only be a fraction of what it is for say Javascript developers, but the JS market is well and truly saturated. The supply of Elixir developers is a fraction of the demand, and that demand is growing at a faster pace than the supply. Looking at the situation purely as "there are only x Elixir jobs out there" isn't painting the full picture.

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:

  • continue to focus on Elixir
  • one of Julia, Rust or Nim (in that order of preference)
  • Python

and as a distant extra, possibly Elm.

@l1x

This comment has been minimized.

Copy link

l1x commented Jan 6, 2019

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.

@nixpulvis

This comment has been minimized.

Copy link

nixpulvis commented Jan 6, 2019

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 String class and just start adding methods (please be careful, and don't do this). The biggest pro of Elixir in my book is the functional nature of the language. You don't need to sell me on all the benifits (I have a λ tattoo ffs). Oh and pattern matching, something I also love about Rust.

@nelsonic

This comment has been minimized.

Copy link
Member

nelsonic commented Jan 6, 2019

@nixpulvis good point. Ruby is the spiritual grandfather of Elixir in both in terms of syntax and ecosystem. Ruby is still widely used in industry and is the "go to" language for many people.
I just would not recommend that people who don't know it start with Ruby as Elixir is objectively "better" in every way (system efficiency, error handling, testing, pipeline elegance, metaprogramming, BEAM, etc...);

All of the "lessons learned" from Ruby have been applied to Elixir (including the good parts of Active Record) and the result is fantastic. Phoenix has fewer "bells and whistles" than Rails, but I personally like that because I can sit down and read all the code in the Phoenix framework in a day whereas it took me a week to read the Rails core code back in the day.
(I printed it out and read it all...! Yes, I'm a freak!)

Ruby on Rails is still immensely popular and actively being taught in several coding bootcamps precisely because it is still used in many companies, but developers who are just getting started
wanting to "leapfrog" their peers, they should stick with the list above.
Ruby would be the 8th or 9th language I would recommend to someone
after JavaScript simply because the proliferation of Node.js and Front-end frameworks.

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".
Just that I lost a lot of time writing/debugging it.
And if I can save someone else the heartache by encouraging them to use Elixir, I will. 👍

@nelsonic

This comment has been minimized.

Copy link
Member

nelsonic commented Jan 6, 2019

@proyb6 no doubt Crystal is very promising.
Though I'm sure you'll agree it is still under heavy development v0.27.0 i.e: expect breaking changes!
image

and you wouldn't use it for your life-support system for your grandmother. 😉

Still, it's definitely "one to watch".
Perhaps we need an expanded list of languages. 🤔 (especially for people with time to "play")
The only reasoning for having an abbreviated list is to help people focus (avoid distraction ...)
Crystal-lang is classic Shiny Object Syndrome ...

Many people treat their programming skills as "work" and don't do any learning in their "off time".
Those people need to be more selective with the languages they chose to learn and master.

If I was only allowed to pick one language to write in 2019 I would pick Elixir hands down all day long.
But it's because I know what I'm building this year and it's heavy on the IOT ...

I expect to have 20+ Raspberry PIs running in @home controlling everything from the lights to the physical access security, security cameras and plant watering .
Python would be my second choice for this because it's easy to write and there are lots of good tutorials, but the "zero-downtime hot" deployment story in Elixir is much better and I need systems that I don't need to manually reboot if (when) they crash.

@nelsonic

This comment has been minimized.

Copy link
Member

nelsonic commented Jan 6, 2019

Why the sudden spike of interest in this thread...? 🤔
Yep, 3rd spot on Hacker News: https://news.ycombinator.com/item?id=18838115 😮
image

@KristerV thanks for randomly submitting it. ❤️

@jarcane

This comment has been minimized.

Copy link

jarcane commented Jan 6, 2019

Rust - a close second to Elixir. Great for systems programming and building cross-platform apps, but expect "breaking changes" as still being actively developed (whereas Elixir is far more "stable").

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?

@nelsonic

This comment has been minimized.

Copy link
Member

nelsonic commented Jan 6, 2019

@jarcane thanks for clarifying. I haven't played with Rust in about 6 months.
I'm stoked that Rust is gaining traction and Rocket is a legit web framework. 🚀
If I was still a "gun for hire" (contractor) programmer I would definitely cultivate Rust skills. 🦄
Anyone following along, read this post: https://www.figma.com/blog/rust-in-production-at-figma

@metacritical

This comment has been minimized.

Copy link

metacritical commented Jan 6, 2019

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.

@nelsonic

This comment has been minimized.

Copy link
Member

nelsonic commented Jan 6, 2019

@metacritical Clojure is a great language + community and an "easy sell" to teams/companies who already use the JVM. Obviously it's unfortunate that you did not feel Elixir was "for you" after trying it in 2015. 😞 (all I can say is that Elixir is much better now...!)

Dave Thomas' Book "Programming Elixir ≥ 1.6" https://www.amazon.com/gp/product/B07DP8Y2GJ/
is not designed for beginners as indicated by the graphic on the back of the book:
image
it should warn people not to use it as their first elixir book;
it's more of a "manual" than a step-by-step guide ... 🙄
I agree with you that it's not the best way to approach learning the language
and there is a bit of a "gap" in the market for an "Elixir for Complete Beginners" Book/Tutorial/Video Series that makes zero assumptions of previous knowledge/skill.

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 Elixir
as it has a fantastic UX and community from a dev perspective.

Start learning Elixir using this repo. https://github.com/dwyl/learn-elixir
if/when you get "stuck" open an issue with a question: https://github.com/dwyl/learn-elixir/issues
The @dwyl community love helping people who are stuck and we usually reply within a few hours.
Cross-post your question on the Elixir Forum: https://elixirforum.com
and StackOverflow: https://stackoverflow.com/questions/tagged/elixir which has several thousand answers and where "Dogbert" https://stackoverflow.com/users/320615/dogbert will usually answer in a few hours.

Ultimately, if people pick Clojure over Elixir that's cool. 🌈
I'm just stoked that Functional languages are gaining traction
because functional code is much easier to maintain
(from experience of writing and having to maintain lots of OOP code...)
and that's ultimately what we do as programmers; we maintain code and attempt to extend it ...

Indeed, the ratio of time spent reading versus writing is well over 10 to 1.
We are constantly reading old code as part of the effort to write new code. ...[Therefore,] making it easy to read makes it easier to write
.”
~ Robert C. Martin, Clean Code: A Handbook of Agile Software Craftsmanship

We spend a lot more time reading other people's code than writing our own.
The more readable the code is the better everyone's lives will be.

I wish there was an objective way of testing code readability with complete beginners
to compare the "beginner friendliness" ... 🤔

These two XKCD comics eloquently describe my experience of Java:

https://xkcd.com/1084/
image

https://xkcd.com/979/
image

Each day I wake up and don't have to read/write Java I'm grateful for my life choices and those of the many much better programmers than me who have paved the way to a functional future! 😉

@nixpulvis

This comment has been minimized.

Copy link

nixpulvis commented Jan 6, 2019

@nelsonic great points! I distinctly remember a professor back in college ranting about how code is meant for humans to read, the fact computers can execute it is mearly a side effect.

@smorin

This comment has been minimized.

Copy link

smorin commented Jan 6, 2019

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

@willricketts

This comment has been minimized.

Copy link

willricketts commented Jan 6, 2019

Stellar write-up.

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.

@sheerun

This comment has been minimized.

Copy link

sheerun commented Jan 7, 2019

On large Node.js projects finding the source of a bug is an expedition!

If you use TypeScript it's more easy. Also newest node adds --async-stack-traces

And since Node is a single-threaded event loop, if the process crashes for one user, it crashes for all the requests being handled by that process.

Crashes are extremely rare in node (and restarts on crashes are handled by deployment platforms) plus unhandled exceptions can be catched with process.on('uncaughtException') which is also automatic e.g. if you use @sentry/node.

JavaScript Fatigue 😫 there is a new library/framework vying for attention every week! (...). Hackernoon post on how everything from last week is obsolete because XYZ framework "changes everything" (for no good reason!).

Nowadays JavaScript package ecosystem is rapidly stabilising and because we went through many iterations of tools, latest ones are pretty good. Compare it e.g. to ruby ecosystem where there was less change but latest versions of "preferred" packages are often first of their kind and poor quality.

JS did not need class. It's a horrible interface!

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.

Facebook trying to "own" the JS ecosystem

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.

@KristerV

This comment has been minimized.

Copy link

KristerV commented Jan 7, 2019

@KristerV thanks for randomly submitting it.

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 ;)

you can't make universal app in it, see Next.js

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.

the post is filled with a lot of claims with no reasoning to back those up

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.

@sheerun

This comment has been minimized.

Copy link

sheerun commented Jan 7, 2019

Hmm, I'm using Next.js and I prefer keeping front and back codebases separate anyway.

It's not about keeping backend (API) and front-end separate (which is fine), but SSR with combination of making a progressive web app.

@KristerV

This comment has been minimized.

Copy link

KristerV commented Jan 7, 2019

@sheerun could you elaborate what you mean by a progressive web app and why I can't have SSR if the backend is separate?

@sheerun

This comment has been minimized.

Copy link

sheerun commented Jan 7, 2019

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

@KristerV

This comment has been minimized.

Copy link

KristerV commented Jan 7, 2019

Don't really want to hijack this topic so last question:

I can still have Next.js and SSR in the frontend and Elixir serving the data in the back. So what is stopping me from writing a Fast, Reliable and Engaging frontend?

@sheerun

This comment has been minimized.

Copy link

sheerun commented Jan 7, 2019

Nothing. Again my point is that "Why Not Stick with JavaScript/Node.js?" is not valid question because nowadays Node.js is used mainly for things that Elixir isn't fit for.

Elixir and Node don't compete with each other, they complete each other.

@l1x

This comment has been minimized.

Copy link

l1x commented Jan 7, 2019

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. :)

@smorin

This comment has been minimized.

Copy link

smorin commented Jan 7, 2019

@nelsonic nelsonic referenced this issue Jan 8, 2019

Open

Why? What? Who? How? #1

0 of 15 tasks complete
@Nmuta

This comment has been minimized.

Copy link

Nmuta commented Jan 10, 2019

'Management (at "big" companies) who don't (want to) understand functional programming or the concept of people enjoying their work, will never see the point of Elixir.'

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment