In C#, are there any good reasons (other than a better error message) for adding parameter null checks to every function where null is not a valid value? Obviously, the code tha
I've been using this for a year now:
_ = s ?? throw new ArgumentNullException(nameof(s));
It's a oneliner, and the discard (_) means there's no unnecessary allocation.
_