Fixing C's Biggest Mistake
Walter Bright
newshound2 at digitalmars.com
Tue Jan 3 08:47:57 UTC 2023
On 1/2/2023 3:20 AM, mate wrote:
> I don’t understand how it can be argued that both approaches are equivalent. In
> the hardware case, the null check is done at runtime. If the programmer forgets
> to handle some edge case, the bug gets released and affects the customers in
> production. In the type system case, the language ensures that, when the
> appropriate type is used, this bug cannot happen. In other words, that fixes the
> billion dollar mistake.
May I quote myself:
"if I do a pattern match to create a non-nullable pointer, where the null arm
does a fatal error if it can't deal with the null, it's the same thing."
More information about the Digitalmars-d
mailing list