Very minor pedantic point about .NET Nullable. The current version of Nullable<T> can only be used with value types. Specifying string? will not compile. It basically lets value types (int, float, etc.) be null. Without this, they just map to byte values on the stack, not memory locations, so they can be zero but not null. This would not map very well to database columns such as int null.
However, nowadays a lot of devs have seen the value in assuming types are not null unless they are explicitly marked as having null as a valid value. So there is an effort underway to bring nullable reference types to C#. Another .NET language is F#. Since it was based on OCaml, it has had the Option type to represent any kind of object as explicitly "nullable" for a while.
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
Thanks for the post!
Very minor pedantic point about .NET Nullable. The current version of
Nullable<T>
can only be used with value types. Specifyingstring?
will not compile. It basically lets value types (int, float, etc.) be null. Without this, they just map to byte values on the stack, not memory locations, so they can be zero but not null. This would not map very well to database columns such asint null
.However, nowadays a lot of devs have seen the value in assuming types are not null unless they are explicitly marked as having null as a valid value. So there is an effort underway to bring nullable reference types to C#. Another .NET language is F#. Since it was based on OCaml, it has had the
Option
type to represent any kind of object as explicitly "nullable" for a while.Cheers!
That's a lot of great info. It would be nice to have Option as an Option!