4 ms·
It is nevertheless a good idea to handle NULL situations as much as possible with dedicated reusable code (such as the listed alternatives: default values, defe
by TuringTest 7y ago
It is nevertheless a good idea to handle NULL situations as much as possible with dedicated reusable code (such as the listed alternatives: default values, deferred creation, options), rather than representing it as a explicit state.
If you allow an explicit NULL state in a data type, every sentence using that type must include checks to handle that exception.
Whereas if you create type definitions capable of handling the exception in their operators, you can use that type and its operators with confidence that all exceptions are handled properly without additional work.