Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> To be honest, I feel like the next few versions of Java will assimilate all of Scala's good features. Java 8 already added lambdas, the optional type, and so on.

Java doesn't have case classes, pattern matches, covariance, or higher-kinded types. Its optional type is seriously flawed in a way that will make migration harder (it can't contain null), and the library ecosystem hasn't yet moved away from using nulls, and while its lambdas are better than before they don't hold a candle to Scala's _ style for conciseness.

Maybe Java will adopt these things in say 5 years - but why would you want to wait 5 years for them? (And conversely: you like the Java 8 features? If you were using Scala you could've had them 5 years earlier).

> In a production system, Scala is quite frustrating to work with because of the frequent backwards compatibility breaks

The backward compatibility breaks aren't very frequent now - that's a lot of what this roadmap is about.

> and the slow-motion build times.

Building can be slow - but only to the extent that you're actually using the fancy features. If you write java-like code (e.g. explicit types on everything) you get java-like build times.

> Not to mention the new stuff which almost but not quite duplicates the built-in Java stuff

You're going to have to mention it - what are you talking about?

> It would be better just to have a better Java, not a hack on top.

It's not a hack on top. It's a full-fledged language (the existence of scala.js is proof of that). The JVM was always intended to support multiple languages.



> Maybe Java will adopt these things in say 5 years - but why would you want to wait 5 years for them?

Exactly.

I'm an Android developer and while I have followed the latest OpenJDK developments on Android with interest, I don't really care much because I and my organization have already switched over to Kotlin. And since mixing Java and Kotlin files is so easy, everybody can do the transition at their own pace (we're still in the transition phase so our engineers are allowed to keep using Java if they so prefer but most of them have already switched 100% to Kotlin and they are not looking back).

It's a bit annoying to review code that mixes Java and Kotlin but it's temporary and I predict than in just a few months, the whole organization will be 100% using Kotlin. I suspect that by the time Android fully supports Java 8, we won't really care about it any more.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: