Live data from Hacker News

Java 21 makes me like Java again

wscp.dev

611–620 of 777 posts

Re: Java 21 makes me like Java again

#611

Earlier quoted context omitted.

You can do that with Java too. The JDK has jpackage, but if you want something better than I'm willing to sell that to you (or give it for free, if you're open source): https://conveyor.hydraulic.dev/ It can be used to ship servers, we use it that way for our own servers. It sets up systemd so you don't need to use Docker. But where it shines is desktop apps. Windows users get a little 400kb EXE that installs/updates…

Java GUI is less appealing though

but it would still be bettter and more performant than electron based apps.

a little memory heavy, but no more than electron apps while being less janky

Re: Java 21 makes me like Java again

#612
post #385

Earlier quoted context omitted.

You can’t decide language superiority by the number of features. While C# indeed has many cool features, I do think it has already went into C++ territory where all the different, independently cool features have very non-trivial interactions that make it very hard to reason about. Also, async-await is not a good thing — virtual threads are superior in every way in case of a managed language.

Why async/await is not a good thing? What makes green threads better? Do you know the difference, the issues async/await addresses that green threads simply do not?

Obligatorily reference: https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...

Re: Java 21 makes me like Java again

#613
post #477
post #278

Earlier quoted context omitted.

> not so great if you want to distribute software for people who are not software savvy, who typically just wants to download one file, install and start using it. i think it's a flaw that wasn't considered properly in the standard java toolchain to not produce an embedded java runtime into a final packaged artifact that is self-executable. You end up with third party tooling like: https://www.ej-technologies.com/res…

There is jpackage and jlink, which don't do single files but make single directory apps. These days there's also GraalVM native image which does produce Go-like results. But with everyone using Docker on the server anyway it doesn't matter anymore. People who talk about single binaries are confusing to me. What are you doing where shipping one file is so much simpler than shipping a container?

> everyone using Docker

Not really.

Re: Java 21 makes me like Java again

#614

Earlier quoted context omitted.

Yes, I'm also not really sure I want to see algebraic types in Java even though I would prefer if a language that focused on algebraic types was more popular. All the existing Java code doesn't go away, so is it really going to be nicer to have code like this mixed randomly into that?

Of all the features most Java devs (and ex-Java devs) desire, algebraic types are near the bottom. How about intersection and union types? (NO, sealed classes are not a substitute for unions). But, yeah, in my view JDK 21 is a a disappointment. I rarely want pattern matching, but I would like properties please and records are nice, but actual tuples are more useful. Etc.

I would love a union type in Java, but I still enjoy the language, community and especially development experience. I wouldn't recommend it for everything, but it's sturdy by design and enjoyable for when it fits.

Re: Java 21 makes me like Java again

#615
java was never really a bad language.

the people were. if not massive over-engineering. too many abstract concepts that make it hard to grasp a codebase.

code voodoo - in the form of reverse GOTO statement i.e annotations

DI frameworks .

what needs fixing is not the language but the ecosystem. there needs to be a "reformation" movement within the java ecosystem.

yeah people migrating to kotlin or clojure or scala isn't enough.

Re: Java 21 makes me like Java again

#616
post #493

Earlier quoted context omitted.

I've never seen Gradle run fast, even with the daemon running. Gradle itself can take multiple seconds to startup. God knows what it's doing.

Gradle is steaming pile of garbage. But since the zoomers are allergic to XML, Maven (actually fast) is slowly dying.

Gradle is much faster than maven as it can properly parallelize the workloads. Sure, it won’t be visible on a hello world, though.

Re: Java 21 makes me like Java again

#617
post #195

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…

> 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. You are just at the early phase of the project. > Go is simple. It's easy to understand, read, and maintain My opinion is that Go is too simple, to the point that it hinders understanding and readability. 4 nested loops with random mutability is much worse…

It would be good for my job if learned go, but I've been having a hard time because it's just so boring.

Re: Java 21 makes me like Java again

#619
post #406

Earlier quoted context omitted.

I mean...Java is run through a VM while C++ is compiled to native code. I can see that being used as a reasonable argument for bloat.

> run through a VM This is just incorrect use/understanding of Java’s execution model. It does have a runtime, but it is definitely not a VirtualBox VM.

What are you talking about? No one brought machine/platform virtualization into this conversation other than you.

The bytecode interpreter for Java (and other similar languages) is literally called a Virtual Machine, due to the way it functions:

https://en.m.wikipedia.org/wiki/Java_virtual_machine

It would seem your understanding of the Java execution model is flawed.

Re: Java 21 makes me like Java again

#620
post #240

Earlier quoted context omitted.

That escalated quickly. There are good and less good people everywhere and using language X does not automatically tell anything about you. If anything I think the cases where you can use Go successfully are only o fraction of the cases where you can use Java successfully. It's not necessarily Java itself but the ubiquity of the JVM and its ecosystem (see Kotlin, see Scala as examplea that have leveraged this ecosyst…

> the cases where you can use Go successfully are only o fraction of the cases where you can use Java successfully could you elaborate why do you think so, and maybe give examples of cases where Go can't compete with Java?..

Imho Go is really good for self contained micro-services. The way Go does binaries and the cross-compilation part are great.

Otoh, Java has a huge ecosystem. Huge. This plus dependency managemnt make it the first choice in most cases. Not even going to go into the massive innertia given that Java has been around for decades (who is going to rewrite everything in go?)

Today most of the time I pick Kotlin which is sort of whatbJava could have been (or maybe will become) with proper investment and care.

Post reply on HN