2 ms·
> The problem isn't NULL, it's languages not enforcing the necessary checks for the "no data" condition. Talking about "NULL" pretty much implies that. When To
by masklinn 8y ago
> The problem isn't NULL, it's languages not enforcing the necessary checks for the "no data" condition.
Talking about "NULL" pretty much implies that. When Tony Hoare talks about null references, it's about every reference being nullable in languages like Java or C#, not about the ability to conceptually wrap/opt non-nullable references in a nullability thingie.
- danesparza 8y agoPsst: I think the thingie you're referring to is called a 'monad': https://en.wikipedia.org/wiki/Monad_(functional_programming) https://en.wikipedia.org/wiki/Monad_(functional_programming)
- bfrydl 8y agoIt isn't. There exists a common monad that solves this problem but a wrapper type like Option or Maybe need not be a monad. For example, `Nullable<T>` in C# is not a monad.
- danesparza 8y agoAha! You're right. I misremembered this excellent blog series from Eric Lippert (a member of the c# design team): https://ericlippert.com/2013/02/25/monads-part-two/ https://ericlippert.com/2013/02/25/monads-part-two/
- masklinn 8y agoNo. The thingie may or may not be monadic, but I'm using thingie because it could be a "library" sum type, or it could be a magical-ish builtin, or it could be some other mechanism.