News for hackers. Stuff that matters.
Re:From zero to 10M lines of Kotlin by kotlin2 on Tuesday October 25, 2022 @10:41AM (#33331075)
> 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.

Re:From zero to 10M lines of Kotlin by origin_path on Tuesday October 25, 2022 @01:15PM (#33333425)
Well, the new Android UI framework (Compose) is fully based on Kotlin and coroutines.
Re:From zero to 10M lines of Kotlin by sorokod on Tuesday October 25, 2022 @03:07PM (#33334840)
> 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 }
Re:From zero to 10M lines of Kotlin by kaba0 on Tuesday October 25, 2022 @03:42PM (#33335217)
Just for comparison’s sake, java is not significantly more verbose.

  final var teens = people.stream().filter(p -> p.age < 20).map(People::name).toList()
Re:From zero to 10M lines of Kotlin by LinXitoW on Tuesday October 25, 2022 @06:38PM (#33337114)
Keep 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.
Re:From zero to 10M lines of Kotlin by lmm on Tuesday October 25, 2022 @10:39PM (#33339131)
Upgrading to a new JDK is significantly less work than upgrading all your tools to support a new language.
Re:From zero to 10M lines of Kotlin by kaba0 on Wednesday October 26, 2022 @01:27AM (#33340141)
JDK 8 came out in 2014 - Internet Explorer was still widespread at the time.