Conversation

The fact that safe language implementations have to think hard about how to handle null pointer exceptions safely should have been a warning sign that null pointers are a bad thing to have in a language. Sadly nearly always unheeded.
5
52
This Tweet is from a suspended account. Learn more
I think the main reason that Go has null pointers is because for whatever reason they really wanted to support automatic zero initialization as the solution to uninitialized data, instead of forcing initialization before possible use via very trivial basic flow control analysis.
1
1
This means that every type in Go has a 'default' zero-based initialization, despite that often not making any sense. It causes a whole class of issues including but not limited to null pointers. I don't think it's good language design. I don't see a compelling reason to do this.
1
1
Show replies