Live data from Hacker News

Java 27

mail.openjdk.org

321–330 of 424 posts

Re: Java 27

#321
This thread, which I read most of, reads like a 'how to be a language-war thread without explicitly being one'. :)

Just use the language the (keeps putting) puts bread on your table. All languages have their own 'baggage'.

Wrt to AI, I agree with pron's comments that for very large code bases, AI can't do 4$hit.

Re: Java 27

#323
post #315
post #268

Earlier quoted context omitted.

Granted, I havent' used either for a couple of years, so my knowledge is a little rusty. Yes, some of them are "just syntax sugar", but man oh man does it make C# such a pleasant language to work with. Used to work at a company which had services both in Java and C#, so some of Java's decisions or indecisions felt like pain points when switching between the two: - Proper IEnumerable with proper iterators that in turn…

At the same time, all this syntactic sugar makes the language's surface area gigantic . Like it's almost C++-level complex, and then you would have to properly understand all the interactions between this matrix of features. That's absolutely a valid language design and many people prefer that, but I personally prefer a bit smaller language with a bit more IDE auto complete, but where you never have to think about wh…

> a bit smaller language with a bit more IDE auto complete, but where you never have to think about what exactly does a line do.

If you need IDE to autocomplete, then you definitely spend more time to understand what a line does ;)

Re: Java 27

#324

Earlier quoted context omitted.

There's not really a second C# runtime. Java has several, some based on the Openjdk, but a few that are completely new like OpenJ9 and Graal. The closest C# has is mono. This sort of thing is bound to happen with that situation. Heck, it happens with C++ whenever a new C++ version comes out. Some C++11 features took years to make their way into all the compilers.

Graal is based on OpenJDK. OpenJ9 while using a separate JVM and JIT leverage the openjdk class path as well as the build environment and various other things. I don’t think there’s a single alternate implementation that doesn’t leverage a good chunk of openjdk somehow

PTC and Aicas for example.

Re: Java 27

#325
post #311

Earlier quoted context omitted.

Graal is based on OpenJDK. OpenJ9 while using a separate JVM and JIT leverage the openjdk class path as well as the build environment and various other things. I don’t think there’s a single alternate implementation that doesn’t leverage a good chunk of openjdk somehow

For the simple reason that class files with JVM bytecode are the standardized intermediate representation. Therefore, duplicating the frontend is wasted effort.

Up to a point.

Embedded systems versions tend to have their own ways, which is why despite everything Android using Dex isn't a first in the Java ecosystem.

Re: Java 27

#326
post #36
post #5

C# dev here: it’s amazing how different this is from a Microsoft release. First off, Oracle are doing versions at approximately twice the cadence. But also, and I’m guessing this is a function of the much larger Java audience: things rarely get two preview versions in a proper release. Updates in beta versions, yes, all the time. It also feels like Microsoft are bundling a lot more into the platform and leaving less…

> Microsoft are bundling a lot more into the platform and leaving less to the community. This is a good thing. In Java everything has multiple community offerings, so before doing anything you have to evaluate the community offerings and decide which one to go with. If you go with the wrong one you may end up having to switch at some point, and that can be painful. This happens so often that most of the time spent wh…

Which is why there are so many complaints about doing FOSS in .NET, as many companies won't use anything that isn't blessed by Microsoft, and there is an history of Microsoft cloning FOSS projects.

Re: Java 27

#327
post #5

C# dev here: it’s amazing how different this is from a Microsoft release. First off, Oracle are doing versions at approximately twice the cadence. But also, and I’m guessing this is a function of the much larger Java audience: things rarely get two preview versions in a proper release. Updates in beta versions, yes, all the time. It also feels like Microsoft are bundling a lot more into the platform and leaving less…

Because there is nothing in it, that's why this release, along with majority of the recent ones drop like wet farts. How many previews of the vector API would you like?

I read nine JEPs. Sure, some are re-Previews, but they are important since they often contain improvements from community feedback. Specifically, it would be quite unwise to finalize the Vector API before Project Valhalla. Apart from that, I'm sure that there are lots of minor visible changes that didn't get a JEP.

Anyway, not every release can be filled to the brim with new features, and people were also kinda busy whipping Project Valhalla into shape. INHO it's still preferable to stick to a predictable schedule instead of creating uncertainty in the community.

Re: Java 27

#328
post #89

Earlier quoted context omitted.

Interesting take, how is optional functionality annoying? Isn't the fact that it's just sugar a huge benefit? Us old timers can simply stick to what we're familiar with.

Because unless you are the only person maintaining your codebase other people in your organization will start using the cool new syntax sugar and optional functionality. So you will be forced to deal with it as it starts showing up in your codebase.

I'm sure that there is a tool like Checkstyle that can be used to ban features.

Re: Java 27

#329
post #290

Earlier quoted context omitted.

yes, so are the NPEs - both are runtime errors indicating a bug in the code. NPE was a major source of irritation 20 years ago, but what many people do not know is that debugging NPEs in Java is easier now - they carry more information about the source. And the culture has evolved.

> but what many people do not know is that debugging NPEs in Java is easier now - they carry more information about the source Unfortunately, no, they don't. Not after your application has been running for a while; newer JVMs arbitrarily decide you don't need the stack trace anymore, and all you see in your logs is "NullPointerException" (unless you still have the logs from several weeks ago, just after the last JVM…

I think parent was referring to this: https://www.baeldung.com/java-14-nullpointerexception

Re: Java 27

#330
post #271

Earlier quoted context omitted.

(GP here) > Isn't the fact that it's just sugar a huge benefit? My main gripe is that I cannot remember what is allowed and not allowed between multiple versions of the same language. On a daily basis I hop between apps versioned in .NET Framework 4.8 all the way to .NET 10. I have to constant remember, are nullable types allowed here? What about 'new(); vs. new Object();', new collection syntax, new switch syntax, n…

Some of those ways come from just plain object initialisers. Which are amazing and sorely needed in Java. That's why you get `new List { };` Because it could be `new ComplexObject { }`. Same for `new`. Some come from type inference which Java also has. That's why you can have `List foo = new List ();` and `var foo = new List ();` It's not really "7 ways to assign a new empty List ". It's "7 ways to create an object",…

> Some of those ways come from just plain object initialisers. Which are amazing and sorely needed in Java.

They really aren't, and they are IMHO an antipattern since they break encapsulation. One might argue that encapsulation doesn't matter with mere data classes, but Java will cater to that use case by introducing withers.

Post reply on HN