4 ms·
> streams are cumbersome to work with because Kotlin has a different approach to absence/nullability I'm not sure that's a reason to pick Java over Kotlin thou
by ptx 3y ago
> streams are cumbersome to work with because Kotlin has a different approach to absence/nullability
I'm not sure that's a reason to pick Java over Kotlin though – streams are just generally cumbersome, even in Java, compared to Kotlin's sequences. By choosing Java you're getting more exposure to them whereas in Kotlin you can mostly avoid them in favor of sequences.
- lmm 3y agoStreams are less cumbersome in Java because you can use optional everywhere and it's relatively idiomatic; the ecosystem (at least the modern parts of it) will support you in doing so. Whereas in Kotlin everything expects you to use their special nullables and so you have to constantly shift back and forth.
- rhdunn 3y agoI've had the opposite experience. I've found using Optional/map everywhere harder to read than Kotlin nullable types. And I find Kotlin streams/streaming API easier to read and use/more intuitive than Java's equivalent.