5 ms·
> "Null: the billion dollar mistake" That was in C, release 52 years ago. > JavaScript [...] doubled it by having yet another null-ish value. And did so 24 y
by cies 2y ago
> "Null: the billion dollar mistake"
That was in C, release 52 years ago.
> JavaScript [...] doubled it by having yet another null-ish value.
And did so 24 years later!
In defense of JS they supposedly designed and implemented the language in 10 days.
I find "implicit nulls" less defensible for Golang (38 years after C) and Java (23 years after C), as they had plenty of time to learn from other's mistakes.
- azornathogron 2y ago> That was in C, release 52 years ago No, it was in ALGOL W. The "billion dollar mistake" is what Tony Hoare - one of the designers of the language - called it (later on, of course).
- DemocracyFTW2 2y ago> "billion dollar mistake" is what Tony Hoare [...] called it (later on, of course) would be damning but also fun if it ever turned out they planted this as a practical joke, fully knowing what they were doing
- afiori 2y agoThe billion dollars mistake is not having nulls, you need some concept of null. The mistake was allowing nulls to be a valid value for all pointers/reference at the type level. You cannot make this mistake in an untyped language like JavaScript* The solution to this is not eliminating nulls but rather separating nullable pointers/references from non-nullable ones * Ok ironically JavaScript has an actual historical implementation bug where typeof null === "object" (basically Netscape used tagged pointers, the object tag was 0, and null was represented as a null pointer, so typeof would read the tag and return "object"
- cies 2y ago> The billion dollars mistake is not having nulls, you need some concept of null. > The mistake was allowing nulls to be a valid value for all pointers/reference at the type level. Hence I call it "implicit nulls" in my post. I know `null` as a concept is important, even if you have it as `Unit`, `Void` or `Nothing`. You are totally right thought that in languages that do not force you to specify types it is basically needed as you cannot hint a type to begin with.