Any sharp edges or issues with scaling projects up with more members? Is it worth the switch from Java with its much more modern syntax and pragmatic helpers?
Will Java eventually catch up? As Project Loom seems to be the superior approach to concurrency compared to co-routines that Kotlin has went with.
(+) * Kotlin is basically a poor man's Scala. So you get most of the syntactic sugar with no need to study much. * Seamless integration with the the Java ecosystem from libraries to IntelliJ. In contrast with the Scala world, so far they seem to be pushing less for building Kotlin native replacements for already existing battle-tested things. * Not that many people trying to write Haskel in Kotlin than in Scala. So less potential for scaring away people and especially companies. * No big new ideas (other than concurrency but from what I have seen most people just ignore that area altogether) so easy adoption
(?) * their idiomatic approach to concurrency is highly unusual. It feels very different in comparison to most mainstream ideas (j.u.c, futures, actors). Very unlike Java or even Scala. Very little literature available on the best practices. In this respect I'd rather see project Loom come to fruition. * their approach to null safety is less verbose than Options but tends to permeate the entire code base quickly. I love me some ternary operator but their abbreviations remind me more hard to remember Scala collections. I am not convinced I want to see that noise for limited benefits (NPEs are more common than OOMEs but still unusual). There will also be a little tension with DI/ORM frameworks where not everything is initialized in constructors.
(-) No killer app (such as Spark for Scala). No obvious candidate to be what Akka is in Scala or Spring in Java. No traction in the Bay Area at least this year. I literally have not seen a single backend job. For comparison, there were Scala jobs here in 2010 when the toolchain was worse than abysmal. No buzz in blogs. Nothing like Scala/Clojure/Erlang ten years ago or Rust/golang nowadays. GOOG PR probably makes people think it's a frontend language.
I routinely encounter companies/teams that say that they cannot attract enough smart people to migrate to Scala. It's extremely surprising in 2020 but it's a fact. For those people Kotlin is a perfect alternative, 80/20-style.
The experience is for the most part pleasing, and I'm sure you will find a lot claims supporting that, so I'll focus on the things that I don't like:
* people tend to abuse some of the features (like extension functions), which sometimes does more harm in terms of readability
* Kotlin offers means to do quasi-functional programming, and people tend to write horrible one liners just for the sake of it.
* most tooling seems stuck in Java 8. So you are stuck in that ecosystem (you can, though, compile with Java 8 and run in java 11 of course).
* for mid-sized applications where it makes sense to use DI, using kapt is sometimes a pain (it's better this days, but still I hate the thing)
* even though the jetbrains support is first class, it is still considerably slower then pure Java code. * very personal: I've come to miss Java's verboseness.
* some tools don't integrate well with it (yet)... So do not expect things like static analyzers to be good or even existent.
If you try to embrace the ecosystem, a lot of tools and libraries are still immature as other folks have pointed out.
But if you stick to the existing Java ecosystem and just use Kotlin for the syntactic niceties, it's great for readability and productivity.
I can’t speak to the approaches to concurrency, but from a day-to-day writing code perspective, it still feels miles ahead of Java in terms of cutting down boiler plate and null safety. Additionally, the support for it in IntelliJ gets better release after release. It’s worth _trying_ to move over from Java, because it’s such a cheap experiment. Add the standard lib, and you get complete interoperability out of the box.
The one caveat to our experience: we did find ourselves switching to Java when we were trying to squeeze as much performance out of something as we could. This was I think Kotlin 1.1 or 1.2, and perhaps the byte code generated now is better, but we did experience some performance hits with the syntactic sugar provided around list comprehension. Overall, however, I much rather prefer Kotlin today if my application is greenfield, and I’ve got a say in how it’s built.
[1] https://medium.com/rocket-travel/kotlin-on-the-backend-at-ro...