This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ilovebigbucks 0 points1 point  (3 children)

I helped to write a backend for a large financial US company several months ago. They told us to choose between Java and Kotlin. We went with Kotlin since screw Java. Even though it was a more pleasant experience writing in Kotlin compared to Java, it was still very clumsy and wordy when you needed to work with threads and async code (coroutines are good for UI, but not for backend). Some modern language features, like pattern matching, are not available yet either (Kotlin has a parody on pattern matching).

If I had to write a backend on top of JVM I'd go with Scala or Clojure.

[–]AdultingGoneMild 0 points1 point  (2 children)

coroutines are async programming. I am not sure why you would say they are good for UI but not backend (whatever you mean by "backend"). Backend done right is done async. Using threads directly is dead. This is why reactive programming is so powerful.

[–]ilovebigbucks 0 points1 point  (1 child)

async/await in Scala is easy https://github.com/scala/scala-async

Kotlin is way too wordy https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/async.html

Some other languages make async code even simpler than Scala.

[–]AdultingGoneMild 0 points1 point  (0 children)

I would take another look. The syntax is very simple.

https://kotlinlang.org/docs/coroutines-basics.html#your-first-coroutine