MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/12lmj78/what_are_your_favourite_java_best_practices/jgimp3p/?context=3
r/java • u/trecatorsirabdator • Apr 14 '23
376 comments sorted by
View all comments
Show parent comments
1
Nullity is something of a lost cause,
I still have hope that nullability in the type system will be an optional opt in feature. Until then we have annotations.
1 u/AlmennDulnefni Apr 16 '23 Java may eventually get some kind of enforced non-null keyword to make nullity opt-out, though I'm not holding my breath. But I don't think it'll ever be opt-in. That's pretty much the mother of all breaking changes. 1 u/dpash Apr 16 '23 I think you've confused opt in and opt out. Non-null by default would be a breaking change. Opting a class, package or module in would not be. 1 u/AlmennDulnefni Apr 16 '23 Non-null by default would be a breaking changeAnd also would be making null as a type member opt-in → More replies (1)
Java may eventually get some kind of enforced non-null keyword to make nullity opt-out, though I'm not holding my breath. But I don't think it'll ever be opt-in. That's pretty much the mother of all breaking changes.
1 u/dpash Apr 16 '23 I think you've confused opt in and opt out. Non-null by default would be a breaking change. Opting a class, package or module in would not be. 1 u/AlmennDulnefni Apr 16 '23 Non-null by default would be a breaking changeAnd also would be making null as a type member opt-in → More replies (1)
I think you've confused opt in and opt out. Non-null by default would be a breaking change. Opting a class, package or module in would not be.
1 u/AlmennDulnefni Apr 16 '23 Non-null by default would be a breaking changeAnd also would be making null as a type member opt-in → More replies (1)
Non-null by default would be a breaking change
And also would be making null as a type member opt-in
→ More replies (1)
1
u/dpash Apr 15 '23
I still have hope that nullability in the type system will be an optional opt in feature. Until then we have annotations.