Article

Why Learn Elixir

By Pluralsight    |    February 22, 2016

We’re excited to announce the launch of our new Elixir Path today! Elixir is a fairly new programming language that’s been gaining a lot of popularity among developers. It was created in 2011 by José Valim, a long-time contributor to the Ruby community. At the time, José and his colleagues at Plataformatec were looking for ways to improve the performance of Rails applications running across multiple CPUs. These types of applications were running into the same blocker: Ruby’s concurrency model. The Ruby language is a great fit for many cases, but writing concurrent code is not one of them.

During his research on how other technologies handled concurrency, José found Erlang and fell in love with it. While the Erlang Virtual Machine (also known as BEAM) was suitable for the types of problems he was looking to solve, José believed the Erlang language was missing some constructs available in other languages. That’s when he decided to create Elixir, a modern approach to functional programming that leverages decades of experience from the Erlang community. Programs written in Elixir are compiled to Erlang bytecode and run by the Erlang Virtual Machine.

If functional programming is new to you, then writing Elixir code will require a major change in how you think about programs — but that’s not necessarily a bad thing. In the words of Alan Perils, a famous computer scientist, “A language that doesn’t affect the way you think about programming is not worth knowing.”

There are some features that are common in popular programming languages — like Ruby, Python, PHP, and C# — that are not part of Elixir, including classes, objects, and for loops. That doesn’t mean we can’t enforce encapsulation, write decoupled code, or iterate through collections in Elixir — it simply means we do this differently.

Some of Elixir’s features, like first-class functions, pattern matching, the pipe operator (|>), and the cons operator (|), as well as techniques like recursion, even allow us to write programs that are just as readable (if not more so) than those of other non-functional languages.

Code School recently released two new Elixir courses. Our Try Elixir course is a quick intro to the language, covering three of its most popular features: functions, the pipe operator, and pattern matching. Once you become familiar with those, you can continue learning with our Mixing It Up With Elixir course, where we cover anonymous functions, recursion, tuples, maps, control flow, and the mix tool. 

About the author

Pluralsight is the technology skills platform. We enable individuals and teams to grow their skills, accelerate their careers and create the future.