How will you handle null references if you are designing a new language?
18 Apr 2018. 1 min read.
Computer scientist Tony Hoare Said:
I call it my billion-dollar mistake. It was the invention of the null reference in 1965
The nullable objects introduces a fundamental problem with type system. For e.g If you declare a object as String, it doesn’t guarantee that the value is real String or null.
We normally skip null checks based on our assumptions in control flow of code. But when we are wrong, the code crashes with Null Pointer Exception. Java 8 introduced Optionals to deal with Nullable objects. But it has some flaws