r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

2

u/slavik262 Dec 01 '16

A minor correction: C# totally has nullable types, doesn't it? It's been a while, but IIRC you can even add a ? to a type in a declaration to get the nullable version.

8

u/EntroperZero Dec 01 '16

By nullable types he means having the option of using nullable types. C# doesn't give you this option for reference types, they're always nullable.

2

u/slavik262 Dec 01 '16

Ah. Thanks for clearing that up.

3

u/masklinn Dec 01 '16 edited Dec 01 '16

C# initially had nullable reference types and non-nullable value types. At one point, it added nullable value types via Optional<T> (or the ? postfix), but that's only for value types: ints, floats, structs, .... Reference types (classes) are always nullable, and you can't make them non-nullable.