3 ms·
Option/Maybe/Result is a Boolean in disguise. It has the same problem as Booleans by supporting only two branches: single happy path and single unhappy path, w
by nivertech 2y ago
Option/Maybe/Result is a Boolean in disguise.
It has the same problem as Booleans by supporting only two branches: single happy path and single unhappy path, when real life may have many paths, and it’s not always clear which of them are happy or unhappy (from the business logic point of view).
Even for purely technical errors, simple OK | ERROR isn’t enough, but should be something like OK | RETRY | UKNOWN_ERROR | FAILED.
- hardwaresofton 2y agoYup, definitely a case for enums there -- I don't think the rule is absolute (I'm not sure you should always use enums over booleans), but much of the time it seems to be true.