> However, that technique is less efficient and more cumbersome than just using a regular pointer.
If these are an actual problem in your code, you're probably overusing "optional" elements anyway. I almost never need them.
> Your whole argument depends on the idea that nullable pointers are somehow this huge source of bugs. But in my 10 years of C++ (and some Java) I haven't found this to be the case.
I see programs crashing due to null pointer dereferencing almost every day, but maybe that's just me. And anyway, the bad effects of the null pointer mistake aren't limited to just bugs. As I said earlier, primitive types wouldn't have been necessary if null didn't exist. And I've seen people put null checks in all kinds of random places so if a null value shows up where it shouldn't have, the program won't even crash and allow you to debug it.
Finally, what really bugs me about null is that it's so utterly arbitrary. There's no real reason for having this magical thing that is a value of every type, but supports almost none of the operations allowed for that type.
> C++ has non-nullable pointers in the form of references. However, despite this fact, programmers continue to use pointers.
That's because you can't make a C++ reference refer to another object once you've initialized it. It's more like a final reference in Java than like an ordinary reference.
> Please don't misinterpret what I'm saying. I'm not necessarily against non-nullable pointers, I'm just saying that the evidence presented here has not been persuasive.
Well, our experiences regarding null pointers seem to differ. I don't think there's much more left to say.