3 ms·
I would prefer a ‘Result<ValueType, ErrorType>’ over stuffing weird ‘hasError’, ‘didTimeout’, etc flags everywhere. It’s much safer to type-check at compile ti
by the_gipsy 8y ago
I would prefer a ‘Result<ValueType, ErrorType>’ over stuffing weird ‘hasError’, ‘didTimeout’, etc flags everywhere.
It’s much safer to type-check at compile time that you have discriminated between result and error, than to hope that you are ‘if’-checking some flags at the right time at runtime.
- squirrelicus 8y agoThat is another way to accomplish the same goal. This trade-off is more aesthetic than architectural and is just a matter of language support