News for hackers. Stuff that matters.
Re:Don't return null; use a tail call by dkersten on Tuesday January 10, 2012 @12:02PM (#3447746)
if(someNumber && someNumber.HasValue)

You still have to remember to do this check. Will the compiler complain if you use someNumber.Value without checking that its valid first? If not, then its not really the same thing.

The point of Haskell's Maybe is that the compiler will make sure that you take both cases (that there is a value and that there isn't a value) into account (because to extract the value you must pattern match and pattern matches must be exhaustive, otherwise you get a compile error).

Re:Don't return null; use a tail call by chc on Tuesday January 10, 2012 @02:44PM (#3448633)
Eh, that's putting it a little too strongly. Haskell is a nice language, but it still doesn't protect you from all your mistakes. The easiest way to extract the value in Haskell is fromJust, which simply errors if no value was returned. I do agree that Haskell makes it more natural, though.
Re:Don't return null; use a tail call by troygoode on Tuesday January 10, 2012 @08:17PM (#3450010)
The compiler won't, no - but many/most developers use static analysis tools like ReSharper which WILL tell you that you have a possible NullReferenceException there if you don't check it.