Hacker News new | ask | show | jobs
by tom-jh 2495 days ago
Take a look at Kotlin. We are building our enterprise products with it. You get all the benefits of Java (stability, maturity) without the bad parts (boilerplate, boredom).

We just hired a Kotlin person (really a Java guy who refreshed his Kotlin over the weekend) for this, and we may be hiring more.

I suspect more companies will start looking at Kotlin in the next 2-3 years, especially for green field projects.

1 comments

The concern I have with JVM languages is that employers will have a constant temptation to just fall back into Java instead of actually committing to the language they've chosen. From what I understand, Kontlin/Scala/Clojure all have relatively easy Java-interop, so it smells like after a while non-Java projects could just become Java projects?

I have heard lots about Kotlin though, and it sounds like most devs that've touched it are huge fans.

Scala and Clojure are a bit of a leap for a Java dev, which may come with some cost. I don't get that feeling with Kotlin - you can kind of slip into it, it's a very easy transition, and then you don't want to go back.

Sure, Java interop will make some code parts look a lot more like Java then like Kotlin, but I can't personally imagine that a team would decide to switch back to Java-only after using Kotlin for a while. Interested to be proven wrong if someone has seen that happen.

> Kontlin/Scala/Clojure all have relatively easy Java-interop

I think that you need to separate out languages that are intended for bidirectional interop (Kotlin/Groovy) from those that provide excellent one-way interop (language uses Java APIs) but less optimal interop the other way (Java uses code written natively in language).

Groovy and Kotlin have great bidirectional interop while Clojure and Scala don't map over nearly as well.

> it smells like after a while non-Java projects could just become Java projects?

Almost never happens in my experience, Java is just too suboptimal compared to these other languages. Once I started using Groovy in a few places it quickly becomes the case that I wanted to use it absolutely everywhere I can - it's just too much better.

I do code it in a much more static style than is often used in Groovy more generally though (declaring types whenever it helps readability, etc). I also always want to define interfaces and key data structures in pure Java if there's no reason to have them written in a different language.

I guess as someone with several years of Java experience and a few years of Scala experience, this is a concern I've never really had. For all of Java's strengths, it is verbose and annoying. I think the biggest lift is the decision to move to something like Kotlin or Scala instead.

I have noticed something like what you describe with Groovy though. We've had groovy enthusiasts that have peppered our java codebases with Groovy. It's not viral or contagious, and ultimately just served to confuse matters and make the code harder to understand. We've had more than a couple of refactor efforts to get rid of groovy code and turn it back into java.