3 ms·
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
by alerighi 5y 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".
- initplus 5y agoEvery 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.