Re:The Logical Disaster of Null
by masklinn on Thursday May 10, 2018 @04:18AM
(#17037152)
The issue is you can't make reference types non-nullable (yet, they're working towards that end for 8.0).
[ Parent
| on HN ]
Those interested in how C# 8.0 approaches the problem might appreciate Mads Torgersen's thoughts on the matter [0] (relevant part starts at 5:40).
[0] https://channel9.msdn.com/Blogs/Seth-Juarez/A-Preview-of-C-8...
Do you know how they're solving the problem of the language expecting a `default(T)` to exist for every type?
You can get a pretty complete overview at https://blogs.msdn.microsoft.com/dotnet/2017/11/15/nullable-...
But essentially they're not solving it: you will get a warning on explicit default-ing of a non-nullable reference, you will get a warning on implicitly initialising/defaulting class fields, but you will not get warnings when doing so for structs or arrays.