Live data from Hacker News

JEP 401: Value Objects (Preview) merged to OpenJDK master

github.com

81–90 of 185 posts

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#81

Earlier quoted context omitted.

Rhis is the correct way to do it in enterprise environments. C++ gets a lotof rage for doing the same thing. The last thing you want in an enterprise environment is that your working code breaks and you have to commit more time to things that were working before.

What I do like about java is that when breaking changes must happen (and they do occasionally), they are almost always small and the java authors signpost it WELL in advance of making the break. For example, this is technically legal in Java and will probably work today. Both foo and bar will synchronize on the same referenced object due to the integer cache. This is something that will break when value types land fo…

Yes. Having a strong spec helps also in general.

I think that, with all things on the table, backwards compatibility, a spec and, where things are broken things are signaled should be the standard for enterprise grade non-toy apps.

Of course, breaking something should be kept to the minimum.

That is why I keep using C++ and, if I have to do backend in the future for webs, I will probably choose Java over C#: stable, multi-vendor, will work in 10 years, stable.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#82
post #15

I feel lonely in that: I mostly love Java as a language. The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.

java the language is amazing the problem with it is entirely cultural. why is `IStatusChangeEntityCreationManagerFactory` everywhere? and why are the frameworks so huge and all encompassing? i think batteries included rails-style frameworks are great, but when i wrote Java, it didn't feel like rails at all none of these are language problems

Show me where IStatusChangeEntityCreationManagerFactory is in the language. Or the standard libraries. Or anything like it

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#83

Earlier quoted context omitted.

What I do like about java is that when breaking changes must happen (and they do occasionally), they are almost always small and the java authors signpost it WELL in advance of making the break. For example, this is technically legal in Java and will probably work today. Both foo and bar will synchronize on the same referenced object due to the integer cache. This is something that will break when value types land fo…

Yes. Having a strong spec helps also in general. I think that, with all things on the table, backwards compatibility, a spec and, where things are broken things are signaled should be the standard for enterprise grade non-toy apps. Of course, breaking something should be kept to the minimum. That is why I keep using C++ and, if I have to do backend in the future for webs, I will probably choose Java over C#: stable,…

Agreed. I'm just happy that Java is willing to make a break when necessary. They do an excellent job of avoiding it at all costs but they won't nuke a very needed feature (like value types) if they can't deliver it without making some small breaks.

You can be pretty sure that a jar compiled for Java 1.0 will work on a Java 25 VM, and that's pretty great.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#84

Earlier quoted context omitted.

java the language is amazing the problem with it is entirely cultural. why is `IStatusChangeEntityCreationManagerFactory` everywhere? and why are the frameworks so huge and all encompassing? i think batteries included rails-style frameworks are great, but when i wrote Java, it didn't feel like rails at all none of these are language problems

Show me where IStatusChangeEntityCreationManagerFactory is in the language. Or the standard libraries. Or anything like it

[deleted]

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#85
post #15

I feel lonely in that: I mostly love Java as a language. The lack of value types is the biggest impediment to certain types of performance. I am really looking forward to this evolution of the language.

java the language is amazing the problem with it is entirely cultural. why is `IStatusChangeEntityCreationManagerFactory` everywhere? and why are the frameworks so huge and all encompassing? i think batteries included rails-style frameworks are great, but when i wrote Java, it didn't feel like rails at all none of these are language problems

Most languages simply don't have all the frameworks that were created specifically for use in an enterprise context. There's cobol and there's maybe C#, Java and then a long tail of everything else.

A lot of the Java stuff actually came out of the Smalltalk community. IBM used to employ a lot of these people and they brought their enterprise stuff with them when things like Enterprise Java Beans became a thing. And because IBM was there, you got everybody else showing up as well. That's why Oracle bought Sun as well to get access to that juicy market.

IBM could have picked any language. But Java was kind of there and new at the time and it kind of did the job. So that's what they jumped on. MS stole a bit of the thunder with dot Net a few years later which is why C# is also very common in that space. But besides that there isn't a whole lot that has similarly wide adoption. Client side is a whole different story of course.

And the reason stuff gets complicated is that there is a lot of design by committee going on in this world by parties that are mutually adversarial and have big budgets.

So, this particular feature comes out of at least 15 (I think) years or so being debated in that sort of committee. It kind of predates the whole inception creation of things like Kotlin. I was at a 15 year birthday party for that at the Jetbrains office in Berlin a few weeks ago. Debates about value classes in the Java community probably go back to last century.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#86
post #47
post #44

Earlier quoted context omitted.

I know and like Java for almost 30 years now. It is amazing how carefully the language is beeing refined. For the cultural aspect, yes, that is sadly true, but I have the feeling that the culture changes. More and more developers realize that there is a better way now (e. g. records instead of dumb classes full of getters and setters). Maybe the main problem is bloated frameworks and their stickyness. The Helidon fra…

+1 for Helidon ( https://helidon.io/ ) - such a great framework, especially the SE variant. Powerful, modern, fast, modularised, and easy to understand. I'm back on Spring for work reasons but use it for all my side-projects.

i am building my own framework on top of it[1]. the biggest thing for me was it was rewritten on virtual threads from grounds up. no vertx. no netty, lesser indirections.

1. https://github.com/sku0x20/stopgap

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#87

I'm always amazed by how much thinking and work the Java leads put in rolling out changes that move the language forward, but make it backward compatible as much as possible.

Rhis is the correct way to do it in enterprise environments. C++ gets a lotof rage for doing the same thing. The last thing you want in an enterprise environment is that your working code breaks and you have to commit more time to things that were working before.

Whatever Java is doing seems a few orders of magnitude smoother and saner than C++ (and I like C++).

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#88
post #16

It's pretty interesting that while both languages still receive new features, Java seems to stay ahead of JavaScript: - Java has long had a modern replacement for Date, while JavaScript's recently standardized Temporal API still isn't supported in Safari. - Java has switch expressions, while JavaScript, despite its Scheme influence, does not. - And now Java is getting value objects, while JavaScript's equivalent tupl…

I personally would never compare the two. Someone said: java to JavaScript is like car to carpet. And I completely agree with that.

as ham is to hamster

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#89
post #16

It's pretty interesting that while both languages still receive new features, Java seems to stay ahead of JavaScript: - Java has long had a modern replacement for Date, while JavaScript's recently standardized Temporal API still isn't supported in Safari. - Java has switch expressions, while JavaScript, despite its Scheme influence, does not. - And now Java is getting value objects, while JavaScript's equivalent tupl…

> JavaScript was not developed as a fork of Java, but much of its basic syntax still resembles Java, so I think it's fair to compare them. It's absolutely irrelevant to compare these two languages. Calling the former "Javascript" was just a marketing trick.

The original version was Scheme, but they made it look like Java for marketing, too.

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#90

Earlier quoted context omitted.

Rhis is the correct way to do it in enterprise environments. C++ gets a lotof rage for doing the same thing. The last thing you want in an enterprise environment is that your working code breaks and you have to commit more time to things that were working before.

Whatever Java is doing seems a few orders of magnitude smoother and saner than C++ (and I like C++).

It depends on how you look at it.

C++ is very different since it is native.

Java is a VM.

This affects lots of decisions in weird ways.

But in essence both commit to backwards stability at the end.

C++ goes for performance, JVM for a more full-featured bytecode vm, etc. but still.

Post reply on HN