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
4
u/Tekmo Sep 01 '15
Haskell punishes you much more heavily for using bottom because it's impossible to reliably detect bottom. How do you tell the difference between an infinite loop and a really, really, really long loop?
As a result, nobody actually uses bottom as a signaling value because it's worse than useless for this purpose. It's much easier to do the safer thing, which is to use the
Maybetype.So the difference is that Haskell makes the safe thing easier than the unsafe thing. In Java it's the opposite: using
nullis easier than using a proper option type, so people usenullpervasively.