News for hackers. Stuff that matters.
Re:What Is Null? (2010) by dbaupp on Sunday August 04, 2019 @12:40AM (#20604469)
In my experience, Option/Optional/Maybe of a type T comes up a lot less than the type T itself. That is, needing "not a valid object" is a rarer than only requiring objects that are always valid.

Those construction exactly exist so that you have to check for it. They force the programmer to think about the "maybe invalid" state, whereas built-in-null doesn't prompt this (and, indeed, since might-be-null is the rare state, people often just assume they're working with a valid instance of the type and don't handle null at all).

There are no comments on this comment yet.