|
|
|
|
|
by QVVRP4nYz
688 days ago
|
|
> I can't think of a reason why you would want to declare something as nullable when not declaring anything automatically makes the type nullable anyway. All existing code is "we don't know if it is nullable until someone reviews it", that is different than explicitly allowing nulls. To add to confusion all Optional<> variables should be not-null or using Optional makes no sense at all. |
|
I use Optional<> but only to indicate at the API level that something can return null. I hope the chaining ability (?. in many languages, implemented as Optional.map()) will also one day make it to Java.