3 ms·
> I have to do explicit null checks and then the compiler/interpreter just "knows" that code in certain places is null-safe through flow analysis. You need to
by mmis1000 6y ago
> I have to do explicit null checks and then the compiler/interpreter just "knows" that code in certain places is null-safe through flow analysis.
You need to do it anyway or you got a crash. Because remove null from a existing language completely is nearly impossible.
And now the compiler is able to know something went wrong in your code instead of happily see you use `null` as a object and crash the whole program.
Besides that, that also benefit the library users that the compiler/ide will tell them `you can't pass null here`