Conversation
Notices
-
Hallå Kitteh (clacke@social.heldscal.la)'s status on Tuesday, 15-May-2018 10:33:10 UTC Hallå Kitteh @natecull My favorite null is the bottom, usually written like your robobutt, but not the same thing. The bottom is the one element in the bottom type, which is a subtype of every other type, so it breaks every attempt to avoid it with simple type constraints. I like it because it is evil.
Java's null is kind of this, and I believe SmallTalk's nil is very much this, although of course those two examples behave very differently, as ST nil accepts every message and returns nil (I believe), whereas trying to do anything with Java null raises an exception.
The non-evil alternative is Maybe monads, I guess?-
Nate Cull (natecull@mastodon.social)'s status on Tuesday, 15-May-2018 07:18:31 UTC Nate Cull Nulls!
I just don't know what to think about them.
Hallå Kitteh likes this.Hallå Kitteh repeated this. -
Hallå Kitteh (clacke@social.heldscal.la)'s status on Tuesday, 15-May-2018 10:26:16 UTC Hallå Kitteh @natecull
> IEEE floating point's NaN, which is Not a Number and certainly is not Zero but is probably also not Null, or is it?
For added hilarity, Not a Number is usually a Number. -
Hallå Kitteh (clacke@social.heldscal.la)'s status on Tuesday, 15-May-2018 10:34:52 UTC Hallå Kitteh @natecull Either way, having a generic null is almost always a bad idea. Use a specific sentinel value instead, like e.g. how Maybe does it. Just like how you should at least throw a MyPackageException rather than GenericRuntimeException, so that callers have the slightest chance at figuring out in a granular way what went wrong.
-