3 ms·
Or... Just use Kotlin?
by rubenvanwyk 2y ago
Or... Just use Kotlin?
- gf000 2y agoWhich has worse no real pattern matching like Java has?
- rhdunn 2y agoI'd like Java to add support for the null coalescing operator `?.` and associated `!.` and `?:`. -- I find this easier to use and read than using Optional or null check code. I find heavy use of Optionals for nullable values can quickly overwhelm the codebase and make it hard to read the control flow. Especially when interacting with other parts of the codebase. E.g. var baz = foo?.bar?.baz ?: return false; vs something like: var baz = foo.map(f => f.bar).map(b => b.baz).getOrElse(null); or using `then`.