News for hackers. Stuff that matters.
Re:Why nullable types? by mmis1000 on Tuesday December 08, 2020 @08:40PM (#25354319)
> 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`

There are no comments on this comment yet.