3 ms·
Lots of zeros is good. One big problem with null pointers is that there's only one of them. (One of a given type doesn't help.) Hoare's "NULL was my biggest
by anamax 2y ago
Lots of zeros is good.
One big problem with null pointers is that there's only one of them. (One of a given type doesn't help.)
Hoare's "NULL was my biggest mistake" rant proposed the wrong solution, namely no null.
- earthboundkid 2y agoI think it would be better if Go had nilptr for pointer types and "nil" only applied to interface types. That would fix the problem of "why did I return nilptr but the value != nil?" But Go should also have a named zero value that applies everywhere, or at least an operator like ? that compares anything to zero.