News for hackers. Stuff that matters.
Re:Java 21 makes me like Java again by acheron on Saturday September 16, 2023 @05:37PM (#37538953)
In other news, we have an upgrade path at work to go from Java 8 to Java 11 pretty soon.
Re:Java 21 makes me like Java again by hmottestad on Saturday September 16, 2023 @05:46PM (#37539044)
Going from 11 to 21 is a lot easier.
Re:Java 21 makes me like Java again by leapis on Saturday September 16, 2023 @05:56PM (#37539128)
Depends- one of the hardest parts of the 11-20 upgrade for us was that cms gc was removed.

If you run a bunch of different microservices with distinct allocation profiles, all with high allocation pressure and performance constraints, and you've accomplished this w/ the help of a very fine-tuned CMS setup, migrating that over to G1/ZGC is non-trivial

Re:Java 21 makes me like Java again by xxs on Saturday September 16, 2023 @06:10PM (#37539263)
Java sort of suck for microservices (microservices suck on their own) as it has relatively high bootstrap cost.

High allocation rate feels weird with micro services - I suppose that depends a lot on the coding style. G1GC is meant for generally large setups, with several cores at least. E.g. the default setup of 2048 areas on 2GB heap means, allocations over 1MB require special care.

Re:Java 21 makes me like Java again by threeseed on Saturday September 16, 2023 @07:24PM (#37539849)
If you GraalVM Native Image or one of the frameworks based on it then bootstrap cost disappears:

https://quarkus.io

Re:Java 21 makes me like Java again by wice on Sunday September 17, 2023 @05:54AM (#37543277)
GraalVm is great, it made our Spring REST API app go from 10+ seconds to 0.5 seconds on startup (not to mention the lower mem and cpu requirements).

Except… when we try to build it with Jenkins on a Kubernetes cluster, this happens: https://github.com/oracle/graal/issues/7182

Re:Java 21 makes me like Java again by hmottestad on Saturday September 16, 2023 @05:59PM (#37539152)
Is that what happened at your company?
Re:Java 21 makes me like Java again by leapis on Saturday September 16, 2023 @06:07PM (#37539243)
Yup. We've clearly benefitted- G1 and generational ZGC have large advantages over CMS- but it's a lot of experimentation and trial-and-error to get there, whereas other deprecations/removals are usually easier to resolve.
Re:Java 21 makes me like Java again by kaba0 on Saturday September 16, 2023 @06:32PM (#37539455)
Isn't the default config correct for pretty much all workloads, unless you have very special requirements? Like, at most one should just change the target max pause time in case of G1, depending on whether they prefer better throughput at the price of worse latency, or the reverse.
Re:Java 21 makes me like Java again by bberrry on Saturday September 16, 2023 @06:54PM (#37539633)
I can't help but think if you're teetering on a knife's edge, only holding on thanks to hyper tuned GC params, then you should take a step back and consider getting out of that predicament.
Re:Java 21 makes me like Java again by taf2 on Saturday September 16, 2023 @05:58PM (#37539145)
do/i/still/need/to/create/sub/directories/for/the/things/i/want/namespace?
Re:Java 21 makes me like Java again by mdaniel on Saturday September 16, 2023 @06:12PM (#37539290)
Only if you're using vim like someone from the 70s, otherwise any sane IDE handles those things for you

But, yes, namespaces are still mapped to paths, it's not like they rewrote the JVM to use blockchain or something

Re:Java 21 makes me like Java again by ttyyzz on Saturday September 16, 2023 @06:26PM (#37539401)
Yeah I really like my IDE doing stuff in the background without me knowing shit about it.
Re:Java 21 makes me like Java again by piva00 on Saturday September 16, 2023 @06:31PM (#37539454)
Yeah, I do like my IDE doing the tedious work for me. It's also really nice to unzip any JAR I need to troubleshoot and know exactly where to navigate to find exactly the file with the code I need.

I like Golang a lot but the standardisation and verbosity in Java-land has some benefits after you get used to it enough to learn to ignore the boilerplate, it's pretty good to have some kind of consistency enforced by the VM when working in large codebases.

Re:Java 21 makes me like Java again by quickthrower2 on Saturday September 16, 2023 @10:45PM (#37540986)
Yes some C# codebases end up with wildly inconsistent namespacing as you can do anything you like
Re:Java 21 makes me like Java again by threeseed on Saturday September 16, 2023 @07:26PM (#37539864)
I don't understand how it is doing stuff in the background.

You literally ask it to move some class and then it does it. And it's very obvious what it's doing.

Re:Java 21 makes me like Java again by Too on Sunday September 17, 2023 @07:16AM (#37543788)
Then you’d be thrilled to hear about all the stuff your NVME drivers are doing in the background without you knowing shit about it. Or maybe you prefer to engrave your ones and zeroes in stone by hand?

Abstractions exist for a reason. In Java, that abstraction is coding in classes and packages, not files of text.

Re:Java 21 makes me like Java again by imbnwa on Saturday September 16, 2023 @07:03PM (#37539688)
>Only if you're using vim like someone from the 70s, otherwise any sane IDE handles those things for you

I don't think that's quite it when Ruby is also from the 90s and figured out not to tie namespace resolution to the directory tree

Re:Java 21 makes me like Java again by segfaltnh on Saturday September 16, 2023 @11:16PM (#37541177)
Let's not hold ruby up as a poster child for modularity.
Re:Java 21 makes me like Java again by unlikelytomato on Saturday September 16, 2023 @11:23PM (#37541216)
I am not sure why this is a problem. Looking at the organization of the resources directory of every project I've ever worked on, I am not sure I want more opportunity for physical and logical concepts to unnecessarily diverge.
Re:Java 21 makes me like Java again by imbnwa on Sunday September 17, 2023 @12:02PM (#37546493)
I mean, its the same idea as custom path config in TypeScript
Re:Java 21 makes me like Java again by chii on Saturday September 16, 2023 @11:45PM (#37541322)
better_than_having_just_a_single_file_that_have_lots_of_functions_without_namespacing
Re:Java 21 makes me like Java again by kaba0 on Sunday September 17, 2023 @02:54AM (#37542222)
Or import ../../../../../asd
Re:Java 21 makes me like Java again by paulddraper on Sunday September 17, 2023 @12:06AM (#37541440)
Yeah, just like Python, Ruby, JavaScript.
Re:Java 21 makes me like Java again by imbnwa on Sunday September 17, 2023 @12:03PM (#37546512)
Ruby modules aren't tied to the file system
Re:Java 21 makes me like Java again by paulddraper on Sunday September 17, 2023 @02:46PM (#37548149)
True, but they are loaded by path.
Re:Java 21 makes me like Java again by wscp-dev on Sunday September 17, 2023 @01:41AM (#37541873)
Yes/you/do/but/the/ide/does/it/for/you/so...
Re:Java 21 makes me like Java again by javcasas on Sunday September 17, 2023 @04:05AM (#37542667)
The/ide/giveths/the/ide/takeths/all/this/could/be/easier/and/you/know/it.
Re:Java 21 makes me like Java again by kyawzazaw on Saturday September 16, 2023 @06:32PM (#37539460)
8 to 17 for us
Re:Java 21 makes me like Java again by minhtran on Saturday September 16, 2023 @11:53PM (#37541376)
Try with 8 --> 11 first then 11 --> 17
Re:Java 21 makes me like Java again by kyawzazaw on Sunday September 24, 2023 @11:49AM (#37634166)
we are going ahead to 17. too much resources spent to do an intermediate step
Re:Java 21 makes me like Java again by MBCook on Saturday September 16, 2023 @06:39PM (#37539499)
We (finally) upgraded last year from 8 to 17. Lots of nice things, I’m so glad we were finally able to. But it was a big project due to some dependencies and how some things were done internally.

I can’t wait for 21, but I’m not sure when we’ll switch. At least it will be trivial compared to leaving 8.

Re:Java 21 makes me like Java again by rendaw on Saturday September 16, 2023 @11:40PM (#37541288)
What were the backward incompatibilities preventing that move? I thought Java was pretty backward compatible, but I've heard this a lot.
Re:Java 21 makes me like Java again by chii on Saturday September 16, 2023 @11:44PM (#37541312)
It's more likely that there's some dependency that is not easy to upgrade, because the upgrade also includes api changes (from the dependency, not from the jdk).

Compound this with multiple dependencies that exhibit this issue. If you have a "legacy" application that does not require active development, there's zero business incentive to invest into the upgrade. Unless you could prove value in having the upgrade, it just doesn't get prioritized.

Re:Java 21 makes me like Java again by wscp-dev on Sunday September 17, 2023 @01:44AM (#37541885)
Java has in recent times actually removed some apis from the standard library, and made some inaccessible (undocumented internal apis especially) so any advanced frameworks that use them would have been affected.
Re:Java 21 makes me like Java again by sebazzz on Sunday September 17, 2023 @01:58AM (#37541948)
7 -> 8, but JBOSS 6 is a pain to migrate away from.
Re:Java 21 makes me like Java again by approxim8ion on Sunday September 17, 2023 @06:36AM (#37543545)
We made the jump from 8 to 17 this year! Some of our developers of course still write 1.6 level code, of course