3 ms·
I 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 n
by hombre_fatal 2y ago
I 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