Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

671–680 of 777 posts

Re: Java 21 makes me like Java again

#671
post #389
post #366

Earlier quoted context omitted.

> The biggest feature in Java 21 is the release of Virtual Threads Is there a good honest writeup on why is this interesting? Very curious. The earliest JVMs had this, green threads. Performance was terrible so it was eventually dropped. I want to fully utilize every CPU and every core I have, why do I want green/virtual threads again?

The JVM automagically swaps out blocking network calls executing in a virtual thread to a non-blocking implementation, so potentially many other requests can be served in the same time. So you get the benefit of async frameworks, with none of the negatives: the blocking model is trivial to reason about, read, maintain, and works perfectly with tooling (you won’t get an exception in some WhateveScheduler, but at the e…

Thanks. Any good books that cover the current java performance landscape but is grounded in the history of what came before?

I used to be heavily involved in java-based server performance and scalability work back in the 90s and 00s but have been working on other things the last decade. But it would be fun to learn more about where things stand.

Re: Java 21 makes me like Java again

#674
post #654

Golang is simple, smart and opinionated subset of Java/C#. Everything moves slowly in corporate world. It will take another at least 2-3 years for large community of Java ecosystem and average devs to adopt Java 21 and capabilities.

Go is just a dumb subset hyped up as simple, but it is useless and slowly it will have to introduce all the remaining pieces in some ugly way as they didn’t plan with them ahead of time - see generics.

That is exactly what I used to think when I started with it. But I changed my opinion after 6 months with Go and eco-system. It's not ugly, it's different and much more concise.

Re: Java 21 makes me like Java again

#675
post #166
post #85

Earlier quoted context omitted.

I don't think Golang devs are waiting to switch to Java if only making a lot of threads was easier. Honestly, its way too early. Virtual Threads will need a a "killer app" (in this case a killer framework) to pull in devs.

Like Helidon Nima, Micronaut, Quarkus or recently, Spring?

I haven't really used or heard of the others but Spring was already quite good and you really didn't need to think about threads very much. This might help some benchmarks but, again, who is pining for "Spring but with more threads?"

I'm thinking something that would be a clear differentiater such as a multithreaded GUI framework.

Re: Java 21 makes me like Java again

#677

Earlier quoted context omitted.

Java GUI is less appealing though

That was true in 2005. Modern Java UI can look pretty great. Two examples: 1. Start IntelliJ and check it out. It's Swing but it feels modern and fresh. 2. Go to https://www.jfx-central.com/ ... JavaFX was introduced years ago to add far better support for modern visuals. JFX Central is a website written with JavaFX itself - it runs server side and streams drawing instructions to the client (implemented using a mix o…

how is jfx-central different from https://openjfx.io?

Re: Java 21 makes me like Java again

#678
post #309

Earlier quoted context omitted.

I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…

I never understood some of the objections to inheritance. It always made it easier for me to reason about the code, not harder.

Some people are aware about various concepts/paradigms and are able to put each to good use where appropriate.

Other follow fashion and if some dick looking for fame declares A as obsolete and B as the new and shiny one (to be replaced soon anyways) then the lemmings would follow and sing the gospel.

Re: Java 21 makes me like Java again

#679
post #407

Earlier quoted context omitted.

> delivering actual software while you figure out how React 32 broke your transcompiler. Say that to enterprise software systems still running on Java 7 or 8 without any clear path to upgrade because their whole systems will break.

It’s almost like there is even a CS law for this exact scenario.. but Java 8 will be around and will still work 10 years from now, plus it is not an insurmountable task to bump it up to the latest version at all. Tell me literally any platform that has a better backwards compatibility story, because honest to God there is simply absolutely none.

C++. And it’s hated for the same reasons.

Re: Java 21 makes me like Java again

#680
post #73

Earlier quoted context omitted.

Having worked extensively in Java, Node, and Python, I’ll take the JVM ecosystem absolutely any day of the week. Me and my catheter will be over here delivering actual software while you figure out how React 32 broke your transcompiler.

No idea why you are comparing Java, which is BE, to React, which is FE. I think I will check Java once they finally make coroutines… I mean “virtual threads” a stable feature. That actually looks exciting… being able to parallelize almost like in Go 5 years ago.

>finally make coroutines… I mean “virtual threads” a stable feature

Don't you mean fibers? Anyway, I'm pretty sure it's targeted to JDK21.

Post reply on HN