Returning a String, a Boolean, or an Integer do not give enough context. Using monad is a simple way to identify if it's a Success or a Failure, depending on your business logic.
There are other gems that help you to encapsulate the logic. The concept of encapsulating logic in order to give more context is not new.
The idea behind all that is to improve readability. I agree it's a new syntax. But once someone explained you / show you some example, it's very easily understandable.
Of course, you cannot just erase all the if in your code with using Monads, it is not THAT magic ahah. And for sure, I still use some return Failure() if xxx.
Let me know if you want to talk more about it, and maybe I can find some more complex codes example ?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi !
Returning a String, a Boolean, or an Integer do not give enough context. Using monad is a simple way to identify if it's a Success or a Failure, depending on your business logic.
There are other gems that help you to encapsulate the logic. The concept of encapsulating logic in order to give more context is not new.
The idea behind all that is to improve readability. I agree it's a new syntax. But once someone explained you / show you some example, it's very easily understandable.
Of course, you cannot just erase all the
ifin your code with using Monads, it is not THAT magic ahah. And for sure, I still use somereturn Failure() if xxx.Let me know if you want to talk more about it, and maybe I can find some more complex codes example ?