Comment by alerighi

4 years ago

Yes, and they are just two usages of pointers. The fact is that, whatever you call it, null pointer, nullable reference, optional, you have to put in a language a concept of "reference to an object that can reference a non valid object".

Every pointer you can replace by a pass-by-value optional or a non-nullable reference is one less opportunity for errors.

Providing more restricted types that can replace raw pointers for many use cases makes languages safer.