← Back to context

Comment by ejboy

1 day ago

I never fully switched to Kotlin. It’s good, but not good enough. I also like the direction Java has been evolving in over the last 10 years, to the point that a JVM server is actually lighter than a Node.js server :)

What wasn't "good enough" for you in Kotlin?

Sure, Java is slowly getting most of the features and sometimes even in a better form because they control the runtime (virtual threads arguably just work). But IMO Java is still incredibly verbose, Kotlin's type system is just better and I've genuinely never come across anything that would be easier to do in Java. Even virtual threads can be used from Kotlin.

  • For me, Java 8 was tolerable. Also used IJ a lot and it hides Java verbosity and reduced a lot of typing. That's why I didn't really see the need to switch. For better or worse, these days I don't even open IJ and just use VSCode + AI Badger mostly to review my changes. Language matters even less.

  • I don't think Kotlin has fully fledged pattern matching with destructuring yet (like in Java's records) does it?

    • No it doesn't, but it also doesn't need it. Whereas in Java you write:

        if (obj instanceof Point(double x, double y)) {
            foo(x,y)
        }
      

      Kotlin with its smart cast feature lets you do

        if (obj is Point) {
          foo(obj.x, obj.y);
        }