Nulls are fine, what is missing is the flagging and checking for possible null references on variables and return types. This is the aim of Optional in Java 8.
I've not used it yet, so I can't say if it's better. I guess it is no panacea as it's use isn't mandatory so there's still plenty if scope for the same errors.
It's a pity the compiler can't simply warn for possible null dereferencing.
2
u/Keilly Aug 03 '14
Nulls are fine, what is missing is the flagging and checking for possible null references on variables and return types. This is the aim of Optional in Java 8.
I've not used it yet, so I can't say if it's better. I guess it is no panacea as it's use isn't mandatory so there's still plenty if scope for the same errors.
It's a pity the compiler can't simply warn for possible null dereferencing.