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

I currently work at a company who is primarily writing in Scala. I really like Scala but assume my next role won’t be in that. Are my two best options Rust and Java if I want to keep some of the typing, functional style, and pattern matching while also moving to a more popular language?


Seconding the sibling comment re: Kotlin. I haven't worked much with it personally, but I've heard from plenty of people that it strikes a good balance between Java being... Java and Scala's floundering.

Rust also checks your feature boxes, but staying in the JVM-verse is almost certainly the safer bet unless you end up really needing fast native binaries that aren't a chore to code.


Kotlin is gaining steam in the Java world. We're moving to make it our default server-side language at my company instead of Java. Given its great Java interop, you can basically think of it as a modern, more functional Java that doesn't have multiple decades of baggage associated with it. I highly recommend considering it in any place you'd consider Java.


Now that Java has caught up a lot with records, value classes, project loom (virtual/green threads), pattern matching. What is left?

Scala has the better type system with union types and effects (a more generic way of having “throws”.)

Kotlin has a nicer way of dealing with optional values with the ? operator.

What’s left is the syntax. Or am I missing something? These alone do not seem to justify moving an organisation.


Java still sucks.

Where are Java properties, so people can stop writing the silly getter setter nonsense?

Where are default parameters and named parameter calls?

Where is the null friendly field access operator ?. ?

Where is the convenient list and hashmap literal syntax?

Why is the stream API so verbose? Why not offer a third generation collections API?

Where are the sane ORMs?

Now here is some JVM hate:

How do I make sure that my application starts up quickly and isn't slow the first time you're accessing a web page after a restart?

How do I make sure that I don't need a 2GB RAM server for a simple web app? Cloud providers are stingy with RAM, so this adds up, even though RAM costs are an insignificant part of overall server costs.

How do I write a CLI app with the JVM? You don't.

So yeah, Java is in this uncanny valley where it is either obsoleted language wise by JVM languages from 2009 and runtime obsoleted by languages like Rust, where you trade off a bit of convenience, which Java by the way does not have either, for a bit of performance.


I spent 10 years or so mostly writing Scala and now am entirely using Rust. I found the transition really easy. Where I work now has historically been a Scala shop and is moving more and more towards Rust as the default. In my experience engineers who are seasoned Scala devs pick it up very quickly




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

Search: