logoalt Hacker News

wood_spirittoday at 3:19 PM3 repliesview on HN

And regretful inventor of the null reference!

His “billion dollar mistake”:

https://www.infoq.com/presentations/Null-References-The-Bill...


Replies

bazoom42today at 4:51 PM

The mistake was not null references per se. The mistake was having all references be implicitly nullable.

He states around minute 25 the solution to the problem is to explicitly represent null in the type system, so nullable pointers are explicitly declared as such. But it can be complex to ensure that non-nullable references are always initialized to a non-null value, which is why he chose the easy solution to just let every reference be nullable.

show 1 reply
adrian_btoday at 4:04 PM

The null reference was invented by Hoare as a means to implement optional types, which works regardless of their binary representation.

Optional types were a very valuable invention and the fact that null values have been handled incorrectly in many programming languages or environments is not Hoare's fault.

show 1 reply
Milpoteltoday at 4:04 PM

I'm pretty sure that this is not true. I talked to Bud Lawson (the inventor of the pointer) and he claimed that they had implemented special behaviour for null pointers earlier. When I talked to Tony later about it, he said he had never heard of Bud Lawson. So probably both invented them independently, but Bud came first.

show 2 replies