HACKER Q&A
📣 philonoist

For WebDev,would you learn Java in 2023 given the JVM based alternatives?


For WebDev,would you learn Java in 2023 given the JVM based alternatives?


  👤 ryloric Accepted Answer ✓
Does that mean you want to stay on the JVM, but not sure which language to pick?

I've been grokking around this space for a week and landscape looks way better than it was 5 years ago for a couple of reasons.

First, Java itself is changing rapidly, there's tons of really new features that make it very pleasant to use and more keep coming constantly. Look at some of them here[0]. There's records, pattern matching, sealed classes make it feel like Scala almost when it comes to Functional data modeling. There's virtual threads now too with JDK 19. Look at additional JEPs to see what's coming.

Second, the web ecosystem seems to have picked up a lot of things from the js/ts world and made things easier to use. Spring itself is easier now with Spring Boot. I've been very impressed with Micronaut, Javalin, Quarkus and Vert.X.

I picked Micronaut cause I like annotations without runtime DI, but any of the others will do just as good of a job. If you like expressjs, Javalin express with type checking and embedded Jetty. If you like reactive style of organizing your app, Vert.X is there and it has a companion Vert.X-web to build web services.

Micronaut and Quarkus also give AOT compilation to a static binary right out of the box using GraalVM. So, startup speeds are no longer a problem if you need to startup fast... meaning lambdas are a breeze.

Unless you're already invested in node/rails or something else, I think Java is a solid option today, especially if it's something you want to maintain over time. Of course, you can use kotlin with all of them, but Scala is not that well integrated in any of them from what I could tell.

[0] https://docs.oracle.com/en/java/javase/19/language/java-lang...


👤 petercooper
Would I? No. But should you? Maybe. Java is hardly the fastest moving language out there but it's still incredibly popular and heavily used in numerous circles, will keep you employed, and has been modernizing enough to not be too much of a drag IMO (depending on the practices of the companies/teams where you end up using it). Java has a good story to tell in quite a few areas (mostly thanks to the JVM, to be fair) and doesn't deserve the reputation it tends to have in public fora.

If you're going on to the JVM anyway, you'll benefit from at least doing some Java even if you end up doing Kotlin or Scala full-time.


👤 logicalmonster
This is more of an extreme generalization than an ironclad rule, but a lot of beginner Java positions are in depressing companies that are not fun and exciting to work at and do mind-numbingly boring stuff. The tradeoff for that is probably better than average job options: if/when you get laid off or outsourced, there's always a lot of options.

That said, Java itself can be a tool to work on pretty interesting problems of course. But you're probably going to take some time to work your way up there.


👤 rlawson
Yep - it's good job security. Learn Java first and then Kotlin or whatever after that. It'll all make a lot more sense if you have a good understanding of core Java/JVM first

👤 gardenhedge
Only if you want career options. If you just want to develop for the web I would say stick to JavaScript.