3 ms·
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 a
by afiori 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.
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.