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.

Required fields*

7
  • 6
    Actually there are languages that don't have null or nil and do not "need to replace it with something else". Nullable references imply that there might be something there, or there might not be. If you simply require the user to explicitly check if there is something there, you have solved the problem. See haskell for a real life example. Commented Mar 3, 2013 at 8:21
  • 3
    @ErikKronberg, yes, the "billion dollar mistake" and all that nonsense, the parade of people trotting this out and claiming it to be fresh and fascinating never ends, that's why the previous comment thread was deleted. These revolutionary replacements people never fail to bring up are always some variant of the Null Object, Option or Contract, which don't actually magically eliminate the underlying logic error, they just defer or promote it, respectively. Anyway, this is obviously a question about programming languages which do have null, so really, Haskell is pretty irrelevant here. Commented Mar 3, 2013 at 14:07
  • 1
    are you seriously arguing that not requiring a test for null is as good as requiring it? Commented Mar 3, 2013 at 14:08
  • 3
    @ErikKronberg: Yes, I am "seriously arguing" that having to test for null isn't particularly different from (a) having to design every tier of an application around the behaviour of a Null Object, (b) having to pattern-match Options all the time, or (c) not allowing the callee to say "I don't know" and forcing an exception or crash. There's a reason why null has endured so well for so long, and the majority of the people who say otherwise seem to be academics with little experience designing real-world apps with constraints like incomplete requirements or eventual consistency. Commented Mar 3, 2013 at 14:18
  • 3
    @Aaronaught: Sometimes I wish there was a downvote button for comments. There is no reason to rant like that. Commented Mar 23, 2013 at 13:08