Live data from Hacker News

Java 20 / JDK 20: General Availability

mail.openjdk.org

111–120 of 356 posts

Re: Java 20 / JDK 20: General Availability

#111

Why not just use C# instead? It was purposefully designed to address and correct the many mistakes of Java, and much more importantly, it's not owned by Oracle.

AFAIK Java was GPL'd by Sun (before the Oracle purchase). This resulted in the OpenJDK, which is the basis for all distributions of Java. Oracle is a big contributor to the development, but so are many others. You can get a pure OpenJDK or any of a number of branded JDKs like those from Eclipse, BellSoft, etc. You can get non-free distributions with support too. A sticking point for a number of years was the TCK (Technology Compatability Kit) used to validate Java, but that too was GPL'd. Java has evolved quite a bit since being open sourced. IMHO C# has some great features, but Java is great for certain things. For instance, making native apps for Mac, Win, and Linux based on modular libraries from the JDK is now fairly easy (and with a modern UI using the OpenJFX framework).

Re: Java 20 / JDK 20: General Availability

#112

Earlier quoted context omitted.

https://github.com/tc39/proposal-pattern-matching I'm not sure if it's stalled or not. But it's being discussed.

We're still developing this proposal. be patient LOL

Wow that's a proposal! I really like the idea of pattern matching, and I'm glad you're steering clear of modifying switch, but I find the sketches in the proposal pretty hard to read, especially with the combinator examples. I hope you guys take your time and stay more proud of what you leave out than what you put in.

Re: Java 20 / JDK 20: General Availability

#113
post #90

I'm curious what is meant by a "preview feature, or second preview feature, or..." in a released product?? I don't suppose they are going to remove it later. So in what way is it a preview? Are they signalling that it might have breaking changes in the future?

You can read all about it here: https://openjdk.org/jeps/12

with a slight addendum here: https://openjdk.org/jeps/8300604

and podcast that discusses both: https://inside.java/2023/03/21/podcast-030/

Re: Java 20 / JDK 20: General Availability

#114
post #94

And here I am still on Java 8 :/

It's interesting how the introduction of "modules" has forced so many to stick with C++17 and Java 8.

C++ has barely any feature complete compiler implementations and build systems aren’t ready for all of its additions, either (CMake and modules in particular). libstdc++ and libc++, gcc and clang are all not ready for production use or rather untested and/or buggy.

Unless you’re targeting MSBuild Visual Studio Solutions and Windows only, C++17 is currently the most up to date, stable, and battle-proven version.

Re: Java 20 / JDK 20: General Availability

#115

Why not just use C# instead? It was purposefully designed to address and correct the many mistakes of Java, and much more importantly, it's not owned by Oracle.

All the while, adding its own mistakes to the pile. As an example, idiomatic Java style is moving away from getters/setters and instead favors builders and immutable types. That whole inheritance vs. composition concept is changing the way Java is being used. Meanwhile, C# has baked getters/setters so deep into their language (as properties) that there's just no moving off of them. Have you tried making a Builder in…

Yes. And with "records" (record classes, something with the characteristics of a tuple or struct) you can get further away from getter/setter boilerplate code.

Re: Java 20 / JDK 20: General Availability

#118
post #40
post #36

This seems like an appropriate place to post the official Java rap: https://youtu.be/b-Cr0EWwaTk

I prefer this one: Java Forever And Ever Movie (Java vs Windows .Net) https://www.youtube.com/watch?v=RnqAXuLZlaE

Awesome but today this would be a different story line ... maybe: two old conservatives (Java and C#) re-inventing themselves to fight against the hipsters (Go, Swift, JS, ...) ;)

Re: Java 20 / JDK 20: General Availability

#119

Earlier quoted context omitted.

All the while, adding its own mistakes to the pile. As an example, idiomatic Java style is moving away from getters/setters and instead favors builders and immutable types. That whole inheritance vs. composition concept is changing the way Java is being used. Meanwhile, C# has baked getters/setters so deep into their language (as properties) that there's just no moving off of them. Have you tried making a Builder in…

Yes. And with "records" (record classes, something with the characteristics of a tuple or struct) you can get further away from getter/setter boilerplate code.

I just wish records had an easy way to facilitate and/or associate a builder with them. Wishful thinking, out of scope for what they are. And of course, it's not hard to write a FooBuilder that's defined to help construct a Foo record.

If Java records could be told to have a private constructor, I'd be completely satisfied with them. I just don't like the ability for callers to be able to directly instantiate a record without having gone through my builder to do so. I want to completely enforce that my record is instantiated with all its invariants dealt with properly. A builder is a very nice way of doing that.

Re: Java 20 / JDK 20: General Availability

#120

Why not just use C# instead? It was purposefully designed to address and correct the many mistakes of Java, and much more importantly, it's not owned by Oracle.

With all my love for .NET, why not continue Java with its new features when it fits to your developer base, existing products etc.

Give it one or two more years and Java is where C# is ... also aesthetically. As did JavaScript.

Post reply on HN