While I was studying Elixir, I had the opportunity to read many books and watch many talks, but I felt very lost because I didn’t know what I had to read or which exercises to do, in order to become a better functional Elixir developer.
The main objective of this material is to show what I’ve been through so you can boost your learning in functional programming with Elixir and be able to start working as a full-time Elixir developer.
Note: Keep in mind that this material is recommended for developers who already know how to code and want to boost their learning with Elixir.
The first part of this content is focused on learning syntax and most important, functional programming. In my opinion, you should go for a functional approach and declarative programming before trying Elixir. That way you can avoid thinking in an imperative form while coding Elixir.
The first step: I strongly recommend starting learning functional paradigm with Elixir by reading Ulisses Almeida’s book Learn Functional Programming with Elixir. It talks about the most important functional programming aspects and will teach you the basics of Elixir meanwhile.
Try to read the book in a group with your friends. People learn faster together and you can talk to each other about your questions. You will also find more energy to move forward and share the experience, like checking the exercises answers and finding out what you did wrong. Try to create pull requests and ask your friends to review your code. Don’t forget to write tests for all exercises.
So, take an hour to talk to your friends and discuss what you read. Try to explain the most important points, and ask questions.
Here is an example of an agenda, demonstrating how you can divide the book and start learning Elixir.
Week 1 (pages 1 to 30)
- Thinking Functionally
- Working with Variables and Functions
Week 2 (pages 33 to 56)
- Exercises bullet 3 and 4
- Using Pattern Matching to Control the Program Flow
Week 3 (pages 59 to 79)
- Exercises bullet 2
- Diving into Recursion
Week 4 (pages 81 to 102)
- Exercises bullet 1 and 2
- Using Higher-Order Functions
Week 5 (pages 105 to 136)
- Exercises 1 and 2
- Designing Your Elixir Applications
Week 6 (pages 139 to 158)
- Reread the previous chapter doing the exercises.
- Handling Impure Functions
After you finish reading Ulisses’ book I also recommend doing some exercises in Exercism. Don’t get too worked up about the algorithms at this point. Just try to practice a little bit to acquire more fluency in the language syntax before moving on.
In the second part, we are going to learn more about how to solve problems in parallel, exploring one of the greatest features of the Erlang Virtual Machine: Processes!
Nowadays when we solve a problem, we tend to think in a sequential way: First, we get the data, then we send the email, etc… With Elixir/Erlang, we can create a process for all of those small tasks and improve our delivery.
For this part, we are going to follow the Elixir in Action book. In this book, we will read only the part 2. Tip: I strongly recommend you to read the first part, so you will reinforce the things we learned from the previous book.
I suggest reading the following chapters:
- Concurrent Elixir
- Concurrency primitives
- Generic server processes
- Building a concurrent system
- Fault-tolerance basics
- Isolating error effects
- Beyond GenServer
- Working with components
In the third part, we will be training and putting everything we learned into practice by doing the course: Developing With Elixir/OTP. It’s a great video class to consolidate what we learned in the Sasa’s book. With this, you will have the opportunity to build processes on your own, play with supervisors and build your own HTTP web server.
My recommendation is to do everything from scratch. Write tests for all of your functions and practice as much as you can, by this, you will be ready to start into an Elixir project.
At Plataformatec, we have study trails for different contents. We created an Elixir trail (this blog post was based on our Elixir trail) to accelerate the learning of our Ruby developers, to be ready to start on an Elixir project.
Do you want to do this trail with the Plataformatec Team? Just come and start working with us in our offices in São Paulo 🙂