How about removing Null-Pointers from programming languages?

Accname

2D-Graphics enthusiast
Reaction score
1,462
Thanks for your single line of thought.

Well, that API looks like it provides about the same functionality as my maybe, plus some fail-fast flavor stuff.

To be honest, I am not a big friend of Exceptions. In my opinion it inflates the code too much.
Having a big try/catch block around every second line of code is very unpleasant to read and doesnt really make anything easier. If at all, I think having hard-to-read code is even more dangerous then possibly mixing something up with NullPointers.

But I guess this highly depends on the application you are coding.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
One way or another, Maybe<T> would have to be used everywhere to guarantee valid objects or at least checking for such.

The problem is less that Maybe<T> needs some extra code, but that there is no language feature in Java with which you can guarantee a reference to be valid.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top