3 ms·
Nullable/Non-nullable reference types in C# 8.0 having nothing to do with Nullable<T> and aren't even implemented using it. C# 8.0 implementation of something
by wvenable 7y ago
Nullable/Non-nullable reference types in C# 8.0 having nothing to do with Nullable<T> and aren't even implemented using it.
C# 8.0 implementation of something like Optional<T> for reference types uses static flow analysis to ensure correct use of potentially null values. That's vastly superior in every way to Optional<T>.
- anthonybsd 7y agoAh yes “superior in every way”. Was wondering when the myopic zealots would come out.
- wvenable 7y agoYes, because it's checked by the compiler using normal constructs. someNullableInstance.DoSomething(); // compiler error if (someNullableInstance != null) someNullableInstance.DoSomething(); // not an error Option<T> is fine but it's a lot of syntax to use correctly.