Re:NULL: The worst mistake of computer science? (2015)
by rusk on Tuesday December 04, 2018 @10:49AM
(#18600446)
Which is the same as if I go and ensure a default "noop" value is assigned ... it's logically a NULL. I don't know anything about it except that it hasn't been assigned.
[ Parent
| on HN ]
Re:NULL: The worst mistake of computer science? (2015)
by icebraining on Tuesday December 04, 2018 @11:35AM
(#18600951)
It's not a NULL. A NULL is a value that is considered by the type system to be a valid instance of a given type, except it doesn't actually fulfill the type's contract. A Maybe is a completely different type, much like a list or a map or a tree.
Re:NULL: The worst mistake of computer science? (2015)
by rusk on Tuesday December 04, 2018 @12:34PM
(#18601585)
Well at this stage you're just being narrow minded.
I think if you read back over this thread it should be clear what I mean.
I proposed that NULL has a purpose. You proposed that Option obviates this. I stress that it's just a neater way to manage the conditions you don't need to model. You point out that in terms of implementation it's different, where I explain that still, logically it's the same thing.
Of course NULL has a very specific meaning in the structure of the language, and when you start using things like Options it makes managing NULL easier, but it's a rose by another name, gift-wrapped, and bundled with some plant food.
Logically however, at the point where you're modelling your problem it's the same.