DEV Community

Discussion on: Mastering Monadical Syntax in Ruby: A Practical Guide to Functional Elegance

Collapse
 
buckled0 profile image
Daniel Buckle

I like the implementation of getting rid of if-else statements but are you worried about readability for devs who’ve never experienced this kind of pattern?

Collapse
 
pimp_my_ruby profile image
Pimp My Ruby

Hi Daniel, thanks for your feedback !

IMO, Monad concept is not so hard to understand but hard to master.

When we introduced dry-monads and monads concepts to our peers at wecasa, the majority of them never used FP before. But in fact, people loved that instantly.
As a friend said " return Success() is the new return true ".
Once we show you basic examples, you may be able to understand the basic (as showed in the article).

The bind / fmap / do notation concept is something we needed to explain deeper because they mean nothing for an OO programmer.

But when you have the fundamentals (Maybe, Success, Failure, bind) in fact you're good to go. Harder concepts will come when you code a bigger architecture, or when you need to interact with bridges.