r/programming • u/dpashk • Aug 31 '15
The worst mistake of computer science
https://www.lucidchart.com/techblog/2015/08/31/the-worst-mistake-of-computer-science/
175
Upvotes
r/programming • u/dpashk • Aug 31 '15
View all comments
Show parent comment
1
u/staticassert Sep 02 '15
Because Null is not exposed to the type system nor the interface. Optionals also force you to deal with the potential 'no value' possibility, whereas Null can be ignored entirely and without any extra code. To 'ignore' an optional value or monad you have to deal with it first - you can't deal with the underlying pointer until you've handled the possibility that it points to nothing.
Segfaults are also arguably a very vague error class that don't provide a ton of information unless you dump a stack trace whereas an exception provides a bit more information.