Nullable Value Types
So far, we’ve examined nullability only in the context of reference types. If this book had been written in the .NET 1.0 time frame, a reference types context would have been the only valid context to discuss the concept. Let’s recap value and reference types first. Their main characteristic lies in the way instances of the type are passed. Value types pass their data by value, whereas reference types just copy a reference to the data, which means sharing can occur.
The fact that null was supported only for reference types was unfortunate, exposing to the surface something that should really have been an implementation detail. Whether a type supports null as a possible value should be decoupled from the type’s physical representation. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access