4 ms·
> You are completely missing the point of Nullable Am I? Apparently so is everyone else because Microsoft has re-worked Nullable<T> in C# 8 to be almost exactl
by anthonybsd 7y ago
> You are completely missing the point of Nullable
Am I? Apparently so is everyone else because Microsoft has re-worked Nullable<T> in C# 8 to be almost exactly like Java Optional! Silly me right?
- wvenable 7y agoNullable/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.