Re:Hello, I’m Mr. Null. My Name Makes Me Invisible to Computers
by int_19h on Monday September 05, 2016 @01:46AM
(#12428373)
Hoare was talking about null references specifically. Or, to be even more precise, making references nullable by default, and allowing all operations on them in the type system, with U.B. or runtime errors if they actually happen.
NULL in SQL is a very different and largely unrelated concept. Though probably a mistake just as bad - not the concept itself even, but the name. Why did they ever think that "NULL" was a smart name to give to an unknown value? For developers, by the time SQL was a thing, "null" was already a fairly established way to describe null pointers/references. For non-developers, whom SQL presumably targeted, "null" just means zero, which is emphatically not the same thing as "unknown". They really should have called it "UNKNOWN" - then its semantics would make sense, and people wouldn't use it to denote a value that is missing (but known).
Re:Hello, I’m Mr. Null. My Name Makes Me Invisible to Computers
by brobinson on Sunday September 04, 2016 @10:02PM
(#12427678)
Sounds like this could have also been mitigated by either the SQL server warning about SUM() operating over a nullable column or a "where foo is not null" clause. Your solution is best, though.
The lesson/mitigation was to add a NOT NULL attribute on top of a DEFAULT 0.