7 ms·
Avoid exception throwing in most code. It's not a good error handling mechanism. Adjust the function signature so that the data types reflect the opportunity f
by mc4ndr3 4y ago
Avoid exception throwing in most code. It's not a good error handling mechanism.
Adjust the function signature so that the data types reflect the opportunity for a failed operation or failed input state. For example, Either monad (most languages). Or you can build one manually with a struct (C) or tuple (Go).