In January I decided to make 2023 my “year of Elixir”; that is, I’m parking coding new things in Python for a while, and will be focusing on learning this exciting functional programming language instead.
I already started learning about it in late 2022, and I’m having great fun continuing to learn it at the moment. The way I’m approaching it is through every possible means; like a learning frenzy.
Initially, I immersed myself in Elixir videos and talks on YouTube to grasp the context “by diffusion”; what the language is all about, how is it unlike Python, what are the key things to know about functional programming, etc. As it turns out, I have done a lot (most) of Python programming in a kinda-functional style, at least in terms of splitting my code up into multiple functions. But, clearly, this is not what FP is really about.
Then, I took a couple of courses on Udemy. As soon as I felt that I grasped the basics, I started to rewrite some parts of my Python code for a business domain I’m familiar with into Elixir libraries, two of which I released as open source.
Before that, I had overextended myself into Ash Framework and Phoenix LiveView, and crashed hard by going too far too fast without understanding the basics.
So, back to understanding the structs, how to built proper function pipelines with the |>
operator, and then how Ecto uses structs in Changesets.
Meanwhile, I was following Stephen Grinder’s course on Udemy and many things just clicked, so I went back to Phoenix (not LiveView yet).
I avoid StackOverflow, but rely more on Elixir’s excellent documentation.
ChatGPT is pretty bad at Elixir, so that’s out of the window (for now). Elixir’s Discord server, however, is full of helpful, patient people.
So, diving into a new programming language, is in my experience all about three things:
- Intense immersion in the context.
- Studying the documentation.
- Practice with real-world projects.
- The language’s community.
Point 3 in particular is indispensable; you can watch, read, listen as much as you want, but the syntax and the idioms only become true knowledge through practice, practice, practice.
And also read others’ code, to see how they do things.