3 ms·
Once LLMs fully understand nullability, they will cease to use that. Tony Hoare called it "a billion-dollar mistake" (https://en.wikipedia.org/wiki/Tony_Hoare#
by stared 2y ago
Once LLMs fully understand nullability, they will cease to use that.
Tony Hoare called it "a billion-dollar mistake" (https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retractions https://en.wikipedia.org/wiki/Tony_Hoare#Apologies_and_retra...), Rust had made core design choices precisely to avoid this mistake.
In practical AI-assisted coding in TypeScript I have found that it is good to add in Cursor Rules to avoid anything nullable, unless it is a well-designed choice. In my experience, it makes code much better.
- hombre_fatal 2y agoI don’t get the problem with null values as long as you can statically reason about them which wasn’t even the case in Java where you had to always do runtime null-guards before access. But in Typescript, who cares? You’d be forced to handle null the same way you’d be forced to handle Maybe<T> = None | Just<T> except with extra, unidiomatic ceremony in the latter case.
- ngruhn 2y agoWhat you mean with unidiomatic? If a language has Maybe<T> = None | Just<T> as a core concept then it's idiomatic by definition.
- hombre_fatal 2y agoTypescript doesn't define a Maybe<T> nor do you need it to have idiomatic statically-typed nullability. It already has: type value = string | null