Welcome to Learn With Me: Elixir. The purpose of this series is to teach you about Elixir as I learn about it. As I go along, I'll be learning the concepts of the Elixir programming language and then writing about a topic I recently learned. I'm hoping to help others learn this language and help myself learn it better in the process of writing. I've heard people say that the best way to master something is to teach it, and I've found over the years that this is indeed true.

I hope that this will be a valuable series, hopefully explaining things from a different perspective: someone who is learning along with you rather than already being an expert. Hopefully, by the time this is over, I will have become an expert.

Language Comparisons

Along the way, I will provide comparisons to a dynamically-typed language, Javascript, and a statically-typed language, C#. I chose these two languages for two reasons. First of all, they are both widely used, particularly Javascript. Secondly, they are the languages I use most frequently and am most familiar with. That's why I didn't choose a combination like Python and Java, although I have used those languages in the past. I will probably occasionally make a comparison to other languages, but I will focus mainly on comparing Elixir to Javascript and C#.

I want to be absolutely clear that you do not have to know either Javascript or C# for this series to be useful to you. You should be able to follow along and learn Elixir with me without knowing either one. The comparisons will help clarify things for people familiar with those languages, and they are intended to serve as additional information rather than essential information you need to know. So Python, Ruby, and Java developers should have no problems following along.

My First Functional Language

I want to note that this will be the first functional programming language I have learned. Well, it will be the first functional language I will truly learn. We learned a bit about ML for a week in a programming language class I took in college a long time ago, but the teacher did not do a good job with explaining functional programming, and I did not understand what was going on. I suspect that I would understand it a lot better if I went back to it now, but I'd prefer to learn a functional language that has a lot of practical uses and a significant community. Sorry, ML fans.

I am familiar with many functional concepts from Javascript (Ramda, immutable.js, lodash) and LINQ from C#, so I'm not completely ignorant of the workings of functional programming. I suspect that this prior knowledge will give me a big head start in understanding a functional language.

Why Elixir?

Why did I choose Elixir to learn for this series? Well, I was originally motivated to learn Elixir after hearing from a series of satisfied programmers who worked with Elixir, either from reading posts online or while listening to the tech podcasts I usually listen to. That's what initially got Elixir on my radar.

Then I learned about its interesting concurrency model. The environment that Elixir runs in implements the actor model, in which multiple "actors", which are self-contained entities, run code concurrently and independently. The actors asynchronously send each other messages, which contain only immutable data (or mutable copies in some languages). Those languages are queued and processed asynchronously by the receiver. The actor model is at a higher level than things like OS threads, locks, and semaphores, which are difficult to use in a bug-free manner. Using the actor model is a good way to avoid the large number of issues that occur when you are sharing mutable data between threads. It's so easy to create some very difficult-to-diagnose issues involving deadlocks or race conditions.

Actor model frameworks also tend to make software very resilient, as there is usually built-in monitoring of actors and the ability to automatically revive actors that crash. That feature can be used to help create more robust and reliable software. I know that Akka and Akka.net have this functionality, and Elixir certainly does.

Actor models have been implemented for JVM languages with Akka and for .NET languages with Akka.net, but this is the first language I've seen where an actor model has been integrated into the standard runtime environment. (Actually, the Erlang language also benefits from this same environment, but I didn't know about that until after I started learning Elixir). Elixir appears to makes concurrent programming so much easier and I was eager to learn more about it. Parallel processing is becoming more important in computing as the number of cores have been increasing in processors, and I've been interested in concurrency for a long time.

Elixir is also a language where many practical things have been built, particularly network- and web-based applications and services. I've heard that an Elixir web server can handle a large amount of traffic while maintaining good performance. I've heard a lot of praise regarding scalability from people who've implemented systems using Elixir. This has also interested me.

That fact that Elixir is a functional language was also a reason I wanted to learn it. I've been wanting to learn a functional language for quite a while. I find that learning languages with different concepts than my usual programming languages has helped me to become a better software developer.

About You

I'm going to be writing this series for someone who is already proficient and experienced in programming. I expect that you are familiar with at least one programming language. Familiarity with the fundamentals of computer science will probably be helpful as well, although I doubt I will go very deep into those concepts, when I mention them at all.

I assume that you are familiar with recursive function calls and how to do things like recursively iterate through a collection via recursion. Recursion is a very important concept for functional languages and you should be sure to understand it well.

So while this series is not meant for beginning programmers, you don't have to be a master programmer to follow along either. I very much doubt I will be delving into any advanced theoretical concepts or heavy mathematics. I'm aiming for practical stuff that a typical experienced software developer will be able to read and understand. I aim to be easily readable and informative.

About Me

You'll find more detailed information about who I am on the About Me page, but I'll give a brief overview of who I am.

My name is Kevin Peter, I'm a software developer living near Sacramento, California, and I primarily work on web applications and web services. My primary languages are C# and Javascript, although I've used C, C++, and Java in the past. I also learned Python a while back, although I never used it build anything significantly. However, just learning it influenced my understanding of programming, and that's where I first encountered constructs like generators, list comprehension syntax, and objects that are actually tables in disguise.

I enjoy writing and teaching people stuff I've learned, and that makes this a particularly enjoyable project for me.

On my free time, I enjoy learning human languages, traveling (where I get to practice those languages), listening to interesting podcasts], and geeking out on history. You can find the podcasts I listen to and videos I watch on the Resources page.

I also have a Github repository: https://github.com/Maultasche. It contains mostly small projects I've worked on during my free time over the years.