woohaaha
Elixir design and refactoring books
I’m coming from Ruby and Rails. I have read some Elixir and Phoenix books. They shed a lot of light about building applications in Elixir. What I’m not clear on is what patterns are promoted for growing Elixir applications. Little things are promoted, as far as I can tell, but it doesn’t get too specific. I’m a heavy book consumer and in Ruby the books that I view as extremely well thought out and thorough include:
Rails antipatterns
99 Bottles of OOP
Confident Ruby
Practical Object Oriented Design using Ruby (POODR)
Refactoring - Ruby Edition
Ruby Science
(and the list goes on)
Are there any books in the Elixir world that cover these topics (design, refactoring) as deeply as these books do in Ruby?
Thank you
Most Liked
kokolegorille
Hello, welcome to the forum.
As I also comes from Ruby/Rails I had the same questions when I started ![]()
But functional programming is not OOP, no object, no classes, and known design patterns doesn’t apply.
It’s just different.
But You might soon see that functional proramming brings You a lot of safety (no mutation) and a different mindset.
Now, when I write Ruby, I try to apply functional paradigm principles ![]()
Here are videos You might enjoy (as I did…)
There is also this recent topic, where some books are recommended…
kokolegorille
I hope You enjoyed presentations, as they were kind of mind blowing for me.
Here is my 2 cents advises…
- pattern matching is THE thing
- |> creates beautiful and descriptive transformation pipeline
- The Enum module is a must
- Lists are not arrays
- Polymorphism can be achieved via protocols
And many more that I forget, all of these You can learn on https://elixir-lang.org
The last advise, for Rails developpers, Ecto is not AR, but You can do equal job… (same same, but different) Here is a post about a free resource on Ecto.
FP is just a mean to achieve greater goal, Here is a post from Erlang creator, about Erlang.
Once You reach the syntax barrier, You will see it allows You to have a complete isolation…
In complete isolation, You can have millions of processes working together. Coupled with a faillback mecanism (Supervisor) You can build softwares that are fault tolerant.
Apart from Functional patterns, there are Design Patterns for processes, it’s called OTP.
kokolegorille
I took the same way You did, just a bit earlier. As You, I read all the Ruby books You mentionned…
I can remember the depressing feeling of not finding the equivalent of what I learned, all those things Sandi Metz was praising… is it just replaced by MFA?
In Ruby, often You find small objects, used for one function only, that could be parser.parse(), presenter.present()… anything like this. In FP You pass a function.
High order functions are so powerful (something Ruby touch with Lambda) that You don’t need Template, or Strategy patterns.
In Erlang/Elixir, we have some famous Erlangelist… this is one of my favourite talk to understand why this difference is so appealing.
He is the author of Elixir in action, and runs https://www.theerlangelist.com/
Popular in Chat/Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








