4 ms·
Eliminating null pointer dereferences (or NPEs, in this case) as a class of bugs is not a "fleeting in vogue trend". It's a useful and IMO necessary step to ma
by kelnos 2y ago
Eliminating null pointer dereferences (or NPEs, in this case) as a class of bugs is not a "fleeting in vogue trend". It's a useful and IMO necessary step to make programming less error-prone in general.
> Personally I've never found nulls unintuitive or hard to use.
That's not the argument. The argument is that it's easy to mess up their use without realizing it, leading to bugs that only show up intermittently at runtime.
I'm just disappointed that this JEP doesn't go far enough; the compiler/runtime will automatically narrow types (e.g. auto-cast from String! to String), without warning, and possibly throw NPEs. That should be a compile-time error.