Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • 1
    Jim Balter: Right, I'm not actually advocating no-nulls, just throwing out the reasons I could think of in favor of it. Commented May 23, 2011 at 23:06
  • 3
    @Jim Balter: I suppose I am confused as to how it would really help in practice though. In any non-trivial program you will have to at some point deal with values that may not be initialized. So, there must be some way to signify a default value. As such, you still have to check for this before going on. So, instead of a potential crash, you are now potentially working with invalid data. Commented May 23, 2011 at 23:19
  • 1
    You also know what happened when you get null as a return value: The information you requested doesn't exist. There's no difference. Either way, the caller has to validate the return value if it actually needs to use that information for some particular purpose. Whether it's validating a null, a null object, or a monad makes no practical difference. Commented May 23, 2011 at 23:54
  • 1
    @Jim Balter: Right, I still don't see the practical difference, and I don't see how it makes life easier for people writing real programs outside of academia. Doesn't mean there aren't benefits, simply that they do not seem evident to me. Commented May 24, 2011 at 0:09
  • 1
    I've explained the practical difference with an Uninitialized class twice -- it identifies the origin of the null item -- making it possible to pinpoint the bug when a dereference of null occurs. As for the languages designed around null-less paradigms, they avoid the problem from the get-go -- they provide alternate ways to program.that avoid uninitialized variables; that may seem hard to grasp if you aren't familiar with them. Structured programming, which also avoids a large class of bugs, was also once considered "academic". Commented May 24, 2011 at 0:22