woohaaha

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

kokolegorille

Hello, welcome to the forum.

As I also comes from Ruby/Rails I had the same questions when I started :slight_smile:

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 :slight_smile:

Here are videos You might enjoy (as I did…)

There is also this recent topic, where some books are recommended…

kokolegorille

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

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/

Where Next?

Popular in Chat/Questions Top

ariandanim
Hello all, I am still learning Elixir, then go into Phoenix, i am try search in google but find the programming phoenix 1.4, another for...
New
peerreynders
Manning 2016 Halloween weekend sale via Deal of the Day Friday, October 28 - Half off all MEAPs - code WM102816LT Saturday, October 29 ...
332 30681 154
New
OmanF
In the attached screenshot (taken from an exercise in “Programming Elixir”) can be shown that BugReport is defined as a struct that, itse...
New
eliottramirez
Hello, I’m trying to learn Phoenix but I constantly find difficult understanding how the framework works, and I think part of this is th...
New
miguelsrrobo
hi i was wondering if it is necessary to learn erlang to learn elixir
New
marciol
Hey, I have very restricted resources and time so I’m trying to understand the best way to learn Liveview in terms of cost/time. The Pra...
New
wallyfoo
Long story short, I have a real world need to create a view for hooking up a shipping terminal to live data, but because of some early ar...
New
Nopp
Hey guys and girls, i am completely “new” to programming, recently played a bit with Python, Ruby and PureBasic, but i want to try somet...
New
pdgonzalez872
Hi! In my quest of becoming the best Elixir dev I can be, I saw one aspect in my career that I’d like to improve upon. This is language...
New
New

Other popular topics Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement