How to handle null values? In general, they are widely used in C#, but are also a cause of pain due to the infamous null-reference exceptions. I think we should in general use exceptions when the input is invalid, as that is also what the .NET framework seems to do in most cases (int.Parse, etc.). We should use null when we want to indicate that no result could be found (e.g. when querying a collection for a value).
If we were to adopt this, that means that the phone-number tests should be using an exception instead of checking for null.
How to handle
nullvalues? In general, they are widely used in C#, but are also a cause of pain due to the infamous null-reference exceptions. I think we should in general use exceptions when the input is invalid, as that is also what the .NET framework seems to do in most cases (int.Parse, etc.). We should usenullwhen we want to indicate that no result could be found (e.g. when querying a collection for a value).If we were to adopt this, that means that the phone-number tests should be using an exception instead of checking for null.