5 ms·
> I find coroutines a really strange and leaky abstraction. I've only used Kotlin on Android, but from what I remember co-routines are not necessary to use. If
by kotlin2 4y ago
> I find coroutines a really strange and leaky abstraction.
I've only used Kotlin on Android, but from what I remember co-routines are not necessary to use. If you don't like them, then don't use them.
Kotlin has a number of advantages over Java. The biggest of which is built-in optional typing. It's also really nice that everything is expression instead of a statement. Library functions like `let` also make code a little nicer to write. And stuff like data classes and better property initialization are icing on the cake. In my opinion, you can write Kotlin exactly as you would Java, but the development experience is much more polished.
- origin_path 4y agoWell, the new Android UI framework (Compose) is fully based on Kotlin and coroutines.
- sorokod 4y ago> built-in optional typing Typing is not optional, everything in Kotlin is typed. What the language has is type inference. The following lines have the exactly same types: val teens = people.filter { it.age < 20 }.map { it.name } val teens: List<String> = people.filter { p: Person -> p.age < 20 }.map { p: Person -> p.name }
- kaba0 4y agoJust for comparison’s sake, java is not significantly more verbose. final var teens = people.stream().filter(p -> p.age < 20).map(People::name).toList()
- LinXitoW 4y agoKeep in mind, you can use Kotlin in any JDK8 project and instantly get all those features. What you're proposing requires upgrading to a new JDK.