After that I just read some codebases. I find elixir codebases extraordinarily easy to read. The language does a great job of making ‘the good way’ also ‘the easy way’, and the linear nature of functional code is much clearer than the usual indirect dependency injected hell. Papercups is a fairly good starting point I think. I liked the livebook codebases too.
It's not a quick start though: I really dig into how Elixir works and move fairly slowly. I've finished covering the language itself, and I'm about to move into the OTP functionality that's inherited from Erlang.
As others have mentioned on some other threads, learning about OTP, Genserver is really worthwhile. Apart from language, the book teaches a bit about that too. But maybe just enough.
Also, the official docs and guides are fantastic once you have your bearings.
it's more like the = sign in math mathematics.
2x = 10 we can deduce x = 5
Here's an elixir example where a bunch of "if/else" blocks are refactored to use case statements, and then from case statements to pattern matching.
https://nickjanetakis.com/blog/refactoring-elixir-code-if-co...
If-expressions is a specialized version that only works on booleans, pattern matching is a more general concept (that of course can be used to implement if-expressions, but so can pure lambda calculus)
And you still have to decide where your code goes at some level. The pattern of having two function variants (one which matches an empty list, and one the head/tail) is a different idiom to looping. So while for loops go away, you still traverse sequences. And more generally, a lot of the if(else) clauses I would normally write, now get solved with pattern matching.
With control flow languages, the where the code goes and what the code does feel very intertwined, whereas with the pattern matching idioms, I find that where it goes, and what it does, are more orthogonally declared.
After using mostly Erlang for several years, 'if' feels like ugly atavism.
It's like sort of Dr Seuss riff for an experienced programmer.
So you've done a lot of program?
Can you, can you, without a reference?
Could you, could you, with nary a pointer?
Will you, will you, use no return?
No for loop? And less control flow goop?
I had to switch back to do some Python and Swift maintenance/development last week after 2 solid weeks of climbing the Elixir newbie staircase, and I was amazed at how much code I write in "normal" languages whose sole purpose is to decide where the code goes next. For the first hour or two my brain kept screaming "why do you keep putting all of these if blocks everywhere?!"