The only way I can think of making this sound and well-typed, is that null supports any fields and any methods, returning always null. This doesn't fit well how many of the languages actually do.
The only way I can think of making this sound and well-typed, is that null supports any fields and any methods, returning always null. This doesn't fit well how many of the languages actually do.
In C++ references fill that role but it's not very difficult to get a reference to a NULL or stray pointer by mistake, unless you make sure to forbid raw pointers altogether. NULL effectively ruins your type system by making all your reference types de-facto optional.
TFA points that out but concludes by saying that "Either approach will work", that's a bit curt I think. It's like saying that if the seatbelt doesn't stop you the windshield will, "either approach will work".
You generally want problems to be noticed close to their origin, and not hide latently in lists and maps, waiting to be tripped over.
This is what Clojure does to an extent - in Clojure, it is called nil-punning and implicitly handling nil values by using the functions that return null on null input makes the code concise and is considered idiomatic practice. In other Lisp dialects, this is even more common, as far as I know.
That sounds a lot like NaN, which is often conspicuously absent from diatribes against NULL.
(And it's not just because of "lazy programmers"; it truly lacks the requisite structure. Even a very Haskell-y Haskell program in the "normal programming" space doesn't have something that looks like a complicated numeric stack... this is where the applicatives and monads and profunctors come in. Well-structured "normal programming", even very "mathematical" "normal programming", is not structured like heavily-numeric code. That's a sort of "complicated stack" of its own, but even then I'd characterize those abstractions as having a structure where you are almost always building properties up as you go "up" the stack. Contrast with the numeric tower where as you build up, you are generally losing properties; numbers are fully ordered, until you add complex numbers. Complex numbers multiply commutatively, until they become quaternions. Any number can be multiplied by any other until the "numbers" become matrices. Etc. The numeric tower builds in the opposite "direction" from the "normal programming" tower. There's a sense in which you could turn it upside down, but it's not one most people are even going to wrap their head around, let alone want to use.)
Delphi's RTL set the FPU flags to default to signalling NaNs, causing some havoc when linked against C and C++ libraries (usually gaming libraries) that assumed otherwise.
You usually don't want a divide by zero poisoning your data, for the same reasons you don't want unnoticed nulls infecting your data structures. Exceptions can be made for scoped blocks of code, but it's not a good default.