5 ms·
Almost all of the null pointer errors I've seen came from not fully thinking things through. I can see the same mistakes happening with non-nullable types becau
by BlargMcLarg 4y ago
Almost all of the null pointer errors I've seen came from not fully thinking things through. I can see the same mistakes happening with non-nullable types because someone got lazy and passed a default value or something. You get the benefit of the compiler shouting at you for not initializing a variable, but that won't necessarily protect you from not thinking every situation through / lazily passing default values / making poor assumptions.
I'm with GP, I'd really like evidence of this before people continue shouting things which aren't proven.
- ReactiveJelly 4y agoBut the languages that are null-safe all have Option, Optional or Maybe. So if I do need a null value, I can make the field optional and the type checker will help me figure it all out.