3 ms·
I heard related issues called boolean blindness. You drop every bit of useful error information and leave only result/no result or true/false. Want to load a fi
by josefx 7y ago
I heard related issues called boolean blindness. You drop every bit of useful error information and leave only result/no result or true/false. Want to load a file and it fails? Access rights? Parsing Error? File doesn't exist? User interrupt? Can all be summed up as an empty Optional, completely useless for any kind of automated or manual recovery or even to decide if recovery is necessary (user interrupt).
- afiori 7y agothat is why in most languages with that approach you have a symmetric error type (Either for Haskell, Result for Rust etc.)
- cies 7y agoand in those langs its trivial and very common to make even more elaborate return/result types containing a very precise representation of all possible result categories.