Alright GANG #ElixirLang, what do we think about this pattern? See dev.to/martinthenth...
3 reposts5 likes
Alright GANG #ElixirLang, what do we think about this pattern? See dev.to/martinthenth...
3 reposts5 likes
It's fine IMO, but I've seen it abused to a point of code being completely unreadable. I'd only use it for simple cases like this - short function names with 1-2 arguments. But I really like what @sasajuric.bsky.social proposed here as the alternative: bsky.app/profile/sasa... It's way better.
Hard pass. I dislike how things which are strongly related (validation and the corresponding error) are separated so far apart. This is what I do instead 👇
An argument could be made that it's better to have functions produce errors that you can easily handle/compose. We use `splode` for this in Ash. Also allows for multiple things to go wrong. hex.pm/packages/spl...