3 ms·
Same, since nullability should be the exception then it is a good thing that is more verbose.
by jeltz 2y ago
Same, since nullability should be the exception then it is a good thing that is more verbose.
- masklinn 2y agoThis is perfectly logical in languages which have defaulted to opt-in nullability from the start, but it’s heinous and would actively hinder migration in languages which are trying to transition (or something similar e.g. Swift is non-nullable but objc interop was a major design factor, and objc has absolutely ubiquitous nullability).
- jeltz 2y agoNot sure why you think it is heinous but I agree with the other part. In a language where null was the default I do not see a migration path where Option<T> can be used. Option<T> only works for languages where nullability was never a thing. The issue is obvious in how useless the Optional<T> class in Java is.
- shepherdjerred 2y agoHow is Optional useless? I've found it to be very ergonomic, though I do wish there was more support for it in the standard library.