News for hackers. Stuff that matters.
Re:JVM/Java: Null-Restricted and Nullable Types by usrusr on Friday August 02, 2024 @10:31AM (#41139070)
I use Optional quite a lot, but only ever as a poor man's

   x?.let{f(it.y)}
via

   Optional.ofNullable(x).map(it->f(it.y)).orElse(null);
Will it at least get taken care of by escape analysis?

These days I'd not even trade the simple but effective approach taken by Kotlin for the full glory of Scala's Option (which is so far beyond the Java Optional).

There are no comments on this comment yet.