Top 5 Elixir Skills to Learn in 2021 [for Juniors]
Elixir is not magic - despite being easy to write in and learn, you need a strong foundation. In this short article, I will give you my personal list of things that are necessary (or at least very much a “should-have”) for Junior Elixir developers.
The power of Elixir is considerable - it is a functional language compiled to Erlang, so you get amazing concurrency and uptime. A narrow core or powerful tools and utilities open a whole world of possibilities and manage complexity as very few languages can. What you write will be able to run for a long time, will tolerate faults, and be easily scalable.
The syntax you will be working with is one of the easiest to learn and conceptualize, especially to those with a flavor of Ruby in their experience. Even to complete newcomers, good building tools and growing vaults of libraries allow a smoother learning curve. Elixir community simply rocks - although, admittedly, it is not huge.
That’s the good part - but let’s get a bit more specific.
- A sense of concurrency and scale
- HTTPS and server stuff
- Pipeline-style data processing
- General Adaptability (tinkering)
1. A sense of concurrency and scale
What is concurrency? Imagine computing as a race, which is won only when every competitor finishes the track. In most cases, the runners (processes) are tied together with a rope - when one fails, the rest cannot move much further. What if you untie the racers, and let them finish in whatever order they like, without affecting the final result?
Concurrency is usually not the first or third thing beginner developers start from, but at worst, Elixir developers should prepare themselves early. Elixir has many applications, but where the magic truly happens is if you need to do a lot at the same time. Unlike the more intertwined ways other technologies work, Elixir can skim through several processes flopping at the same time - as probably, dozens more will run independently and fault-free in the background.
Without this coupling, an Elixir system can have some self-repairing qualities, its processes are very light, and therefore can be run on all CPUs at the same time. In this respect, Elixir is like its father, Erlang, which is described as “write once, run forever”. They both share a concurrency model, which is markedly different than the usual threading. The key distinction here is this:
You share data by passing messages
Passing messages to share data
If this is not clear (it is much clearer in practice), head here to read a little bit more about how Elixir manages concurrency. For a more descriptive account, listen to this podcast episode from Dev’n Life.
You will need a strong grasp of concurrency and the underlying actor model to start doing more complex things in Elixir, and therefore, to jump up in seniority. Start early!
2. HTTPS and server stuff
A lot of your future work in Elixir will be related to web apps. Therefore, more generally, it will be governed at some level by the HTTP protocol and server infrastructure.
Elixir is armed with some sneakily good web frameworks - I’m talking Phoenix and Absinthe, to name the most popular. But you can’t do much in them without at least basic knowledge of how the web works.
There are several things I would start with. First, learn the basic request-response communication cycle, which is nicely explained here. You should not only know the HTTP status codes but what to do when they occur. A useful distinction is that between POST and PUT methods, and there is a good explainer thread over at Stack Overflow. This one-hour video will bring you up to speed with using cookies in HTTP. Next, polish your knowledge of HTTP headers, courtesy of Mozilla. A nice finishing touch for this starting inventory would be some Web Socket knowledge. It is a broad topic, but read this blog post to get the basics.
If you have most of the above covered and want to build up the case for future promotions, learn some DevOps practices and philosophy. Beginner level tutorials are available on youtube, with dozens of free or cheap courses available in Udemy or Coursera. This will come in handy both for Elixir work, and server.
If you struggled with databases in your previous technology - worry not, Elixir will make your life a bit better. And if you have no relevant experience, Elixir will not throw many logs under your legs during the learning process.
Do not get too happy yet - Elixir, as I will explain in the last point of this list, is not for those, who want everything out of the box. With databases, a typical Ruby deployment will do a lot of stuff for you, like the creation of the initial database and seeding it. In Elixir, however, some of it is on you.
Since you will spend considerable time developing apps with PostgreSQL or some similar SQL databases for data storage in your project, knowing how Elixir works with them is a useful thing to flash during the recruitment process.
4. Pipeline-style data processing
As Elixir is a functional language, it heavily promotes data processing that can be described as pipelines modeled as compositions of functions that transform immutable data structures. If you find this style of data processing comfortable, you will feel at home. Once you get more advanced, libraries such as GenStage or Flow will make you feel at home applying it in a distributed environment, which is one of Elixir’s main strengths.
5. Become a Master Tinkerer
Who is a tinkerer? In short, it is a person who, when seeing an unknown button or dial, is going to press it - just for the, ekhm, sake of it. A person that wants to go deep into things, and is persistent enough to look for their own solutions, where there may be none present yet.
The whole idea behind Elixir is, that you have a powerful core, that must be supplemented by libraries that contain the “extra” functionalities. This was done to reduce bloat and keep processes inherently light and quick. This philosophy also permeates to the library creators themselves.
So when you try to find a very specific library for a niche task, this is not Java or Ruby - where a short trip through GitHub will give you 20 proposed solutions. In some cases, be prepared to write stuff on your own. Elixir is exceptionally extendable. Its core and the underlying power of BEAM VM are meant to be applicable to a very broad set of use cases.
Good luck on your path to Elixir excellence! Michał