Live data from Hacker News

Java 25 officially released

mail.openjdk.org

51–60 of 260 posts

Re: Java 25 officially released

#51
post #8
post #6

Earlier quoted context omitted.

I hope structured concurrency ends up feeling better than async/await with less sugar. The examples do not instill confidence, but we shall see.

Unfortunately on .NET side, TPL Dataflow doesn't get enough love.

Agreed. This is how I feel using it: https://xkcd.com/297/. It's from 2012! I hadn't even written my first `public static void main(string[] args)` then.

My favorite parts of TPL Dataflow are using Channels + Encapsulate to create custom blocks, backpressure, and parallel execution while maintaining ordering. Great library. I sometimes wonder if it would be possible/useful to implement a TPL Dataflow 2.0 on top of Channels.

Re: Java 25 officially released

#52
post #39

More new programs should be written in Java/on the JVM. Most of the reasons Java dropped out of popularity no longer apply, and at this point it is an incredibly stable and mature ecosystem. I can come back to a Clojure program I wrote ten years ago and it runs great , meanwhile a TypeScript program I write 6 months ago requires a bunch of updating and cleanup.

In the circles I see, Java isn't popular because it's verbose and boring to use. These days I don't see those as significant issues, tbh. I would prefer a Clojure program, but I'll take Java over Typescript at this point.

> it's verbose and boring to use.

Python code that follows traditional Python paradigms is called "Pythonic".

Java code that follows Java paradigms is called "awful".

To be fully transparent, I've never written Java professionally, only for a couple small hobby projects 10 years ago, plus some while in school, so my opinion isn't worth the pixels you're reading it on, but I look at most Java code with abject horror.

Endless levels of abstraction. The apparent inability to write a simple function and instead creating a "ThingDoer" class with a single function called "doThing". Run-time introspection and reflection EVERYWHERE. Stack traces that are just an endless stack of calls to functions like ".invoke" and ".run".

I've been under the impression that all of that is a by-product of Java's strict type system, but someone please correct me. Why do Java paradigms seem so awful?

Re: Java 25 officially released

#54
post #47
post #39

More new programs should be written in Java/on the JVM. Most of the reasons Java dropped out of popularity no longer apply, and at this point it is an incredibly stable and mature ecosystem. I can come back to a Clojure program I wrote ten years ago and it runs great , meanwhile a TypeScript program I write 6 months ago requires a bunch of updating and cleanup.

I'm secretly hoping that Kotlin and Compose will bring back Desktop apps on the JVM :-).

I'm rooting against Kotlin since it appears to be only usable with the JetBrains ide. I'm totally blind and Jetbrains tools are not nearly as accessible or easy to use as VS Code with all the Java extensions in my experience. At all the jobs I've had no one cared if I didn't use Idea, but considering it looks like there's no good VS Code tooling for Kotlin if I have to use Kotlin professionally it's going to be painful.

Re: Java 25 officially released

#56
post #11

What is the current situation of using Java (from legal standpoint)? In open source and in commercial setting? Oracle has a lot of fantastic technology locked up in Java (things like Truffle), how reasonable it is for new projects?

The only real nut right now is, if you're using the Oracle distributions, only the latest LTS is, essentially, free to do anything with. Older releases are under their OTN license, which is only for personal and development, but not production. Again, this only matters if you want an Oracle sticker on your runtime, OpenJDK and the other projects are full boat "do whateva" JDKs.

Note that the previous Java LTS release license reverts to the OTN license one year after the new Java LTS version is published, making it no longer free, assuming you keep up with the security updates. See the license note on the Java 21 LTS version[1].

[1] https://www.oracle.com/uk/java/technologies/downloads/#java2...

Re: Java 25 officially released

#58
post #54
post #47

Earlier quoted context omitted.

I'm secretly hoping that Kotlin and Compose will bring back Desktop apps on the JVM :-).

I'm rooting against Kotlin since it appears to be only usable with the JetBrains ide. I'm totally blind and Jetbrains tools are not nearly as accessible or easy to use as VS Code with all the Java extensions in my experience. At all the jobs I've had no one cared if I didn't use Idea, but considering it looks like there's no good VS Code tooling for Kotlin if I have to use Kotlin professionally it's going to be painf…

As of somewhat recently, Kotlin has a language server: https://github.com/Kotlin/kotlin-lsp

Using it in vscode, while not perfect yet, is starting to be alright.

Re: Java 25 officially released

#59

Earlier quoted context omitted.

Neat, I wrote some swing apps back in the day that I've thought about resurrecting, but didn't want to have to do much modifying since they are mostly toys, though useful to me. I'm gonna give it a try!

Is Swing good now? Usually when people say Java is good now I assume they're not talking about Swing.

It's as great as it ever was. I like it as its very stable and has a good model of interaction but if you want a modern embeddable map or embeddable chart stick with web interfaces. If you do go with swing definitely check out flatlaf to make it look modern.

Re: Java 25 officially released

#60

Crazy that it took this long to allow parameter validation and transformation before calling super in the constructor. That was something that always bothered me because it felt so counterintuitive.

Especially because you were always able to bypass it by declaring a `static` function and calling that as part of the parameters to `super`: public Foo(int x) { super(validate(x)); } validate would run before super, even though super was technically the first statement in the constructor, and the compiler was happy.

This is such a funny workaround, I like that. But it doesn't matter in any library or your own code, since factory methods are much better (simply because they have names).
Post reply on HN