r/programming • • Mar 04 '20

Java 14 Arrives with a Host of New Features

https://blogs.oracle.com/javamagazine/java-14-arrives-with-a-host-of-new-features
194 Upvotes

138 comments sorted by

View all comments

Show parent comments

4

u/pron98 Mar 05 '20 edited Mar 06 '20

They cause nothing but pain for the other 99% of Java developers.

No, they make the JDK more secure and more maintainable, and they are what frees up resources to work on other stuff. It's like saying that the city tearing up your street to put in cable ducts is just thinking about themselves and how it would make it easier for them to install and upgrade your broadband lines.

And that pain they're causing some people? It's because of technical debt in the ecosystem that relied on internal implementation details and had to be paid sometime. Once that reliance is scraped off, upgrades are much easier than ever before.

aren't thinking about the other 99%

Oh, we are thinking about the 99% (and more!) all the time. There's just this 0.01% that we don't think much about. Some of them are on Reddit, I think.

and we all got rich

Are you sure you're in touch with the 99%?

It's nice to vent from time to time, but if you actually sat down and learned about all the changes in OpenJDK, I think you'll be pleased.

1

u/_INTER_ Mar 06 '20

There was no need to make modules public though.

2

u/pron98 Mar 06 '20 edited Mar 06 '20

True, but if OpenJDK hadn't made them public, people would have complained that they're not public. I think that just as modules help the JDK reduce its maintenance effort and improve security, they can also help applications do the same, perhaps once all the tooling supports them well. But people don't have to use them, and that they're public hasn't caused anyone any additional pain (well, that's not 100% accurate: people who do want to use modules run into additional issues with tooling; I expect this to gradually improve).

Also, modules, being the most visible feature of JDK 9, are often blamed for problems people have with the upgrade. But the change to the version string format and to the application class loader have caused more issues than modules.

1

u/_INTER_ Mar 07 '20 edited Mar 07 '20

I agree with everything you said. However I'm indifferent to having the module system. There could be large monoliths that might benefit from spltting it up in modules but these days many backends moved to a micro-service architecture or have the build system dictate the "modules". Here the Java module system would just add complexity or you'd need to duplicate everything in your build file and the module-info.java.

if OpenJDK hadn't made them public, people would have complained that they're not public.

Trying to make everyone happy is a battle you can only loose.

Also, modules, being the most visible feature of JDK 9, are often blamed for problems people have with the upgrade. But the change to the version string format and to the application class loader have caused more issues than modules.

At our place there was no direct issue with modules when migrating to Java 11. Rather indirectly through the removed Java EE modules (we skipped 9 and 10), sun.misc.Unsafe, reflection / classloader changes and then the move away from Oracle JDK to AdoptOpenJDK builds (while moving to 64-bit, figuering out key store stuff etc.). It also took some time to setup the build so it includes the JDK (no JRE) in our installation and create a sort of installer / starter with all the flags set.

At that point the major libraries / frameworks had already dealt with their migration and the version string format. So kudos to them.

What I think it would be a problem though is when Oracle decides to remove the kill-switch option --permit-illegal-access. Our debug startup log is pages full with warnings related to 3rd party libraries.

2

u/pron98 Mar 08 '20

Here the Java module system would just add complexity or you'd need to duplicate everything in your build file and the module-info.java.

A. You don't have to use it, and B. it wouldn't add any complexity, because if each app is an atomic microservice, then its module declaration is trivial. In any event, modules are useful when you want to modularize; when you don't -- they obviously don't help and aren't meant to help. Generics also aren't useful when writing a class that isn't generic.

Our debug startup log is pages full with warnings related to 3rd party libraries.

It might be time to put some pressure on those libraries to address that. With or without a kill-switch (that might change its default but won't go away any time soon), all those places are technical debt that make updates hard (they rely on internal implementation details that may change in any release, including LTS patches).