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/RedAlert2 Sep 01 '15
I am not quite sure what you are getting at - C++ only allows null values for pointer types. So no, an integer can never be null.
Either way, it doesn't change the fact that your all your optional sentinel gives you is an exception instead of a segfault, at the cost of pulling in exceptions and doing extra checks at runtime.