2 ms·
There is no way (from a type perspective) to guarantee in C# that an instance of a class can never be null -- this has to be ensured by code logic, conventions,
by dgudkov 10y ago
There is no way (from a type perspective) to guarantee in C# that an instance of a class can never be null -- this has to be ensured by code logic, conventions, etc. As application gets bigger it becomes easy to overlook a case that leads to a null reference exception.
The type system in F# can guarantee that an instance of a class can never be null and you can always refer to it safely.