3 ms·
Ideally these cases would be caught at compile time, by using a rigid set of types. However in reality it's easier to "defend" against bad input with ArgumentE
by gitgud 9y ago
Ideally these cases would be caught at compile time, by using a rigid set of types.
However in reality it's easier to "defend" against bad input with ArgumentExceptions. Especially if input is a basic string or int, which can be null, negative etc.
I guess it's basically defending your method from errors in the caller method, while also keeping it flexible for the caller, by allow simpler unsafe types like strings.