Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Same, since nullability should be the exception then it is a good thing that is more verbose.


This 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).


Not 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.


How 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: