Hacker News new | past | comments | ask | show | jobs | submit login

http://www.computerworld.com.au/article/261958/a-z_programmi...

Anders estimates 50% of the bugs in C# and Java are due to null dereferences.

Your example illustrates the unsafety of undefined, not the unsafety of nulls/Nothing. And you can of course grep for use of partiality in Haskell code and get warnings about partiality in your own functions.

I've seen NULL causing a lot of trouble in production in every setting I've been.

It is very rare to see people mis-handling a Maybe value in Haskell, simply because you have to be explicit about ignoring the Nothing case.

Also, in Haskell, if you get a Maybe value it is a very clear indication that the Nothing case actually exists and you have to handle it. In C, C#, Java, Go, when you get a reference, it is unclear whether it could be null or not in practice. Checking for null when it isn't warranted is dead code you never test. Avoiding checking for null risks missing checks in cases you actually need to check. All of this is simply not a problem when the types don't lie.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: