66 points · by Igor_Wiwi · 2y ago · 67 comments
I will be the first to admit that I have not adopted "modern Java", mostly with all of the functional stuff (notably all of the collection streams and what not).
I certainly enjoy easy lambdas, but I don't necessarily code stuff up that way.
I'm not big on locked down classes, as a general rule. I won't say I never use "private", but it wouldn't bother me if that didn't exist. I can't say I'd "never" use records, but I'm so used to the boiler plate, I don't really see it any more.
My one issue, though, is simply how heavy handed the Java 9 module system is. I have a desktop app, and I use the module system to lighten up the JRE that it bundles. But that's an edge case (to me).
I'm just not a fan of it, I find it gets in the way more than anything, and it just seems more forced than optional.
Outside of building JREs, does anyone use the module system for anything?
catch (Exception e) {
if (e instanceof IOException) {
} else if (e instanceof SQLException) {
} else if (e instanceof NumberFormatException) {
} else {
}
}
Older Javas already allowed choosing which Exceptions (and subclasses) to catch directly.I think OpenJDK 17 might also the highest LTS installable one on Debian 12 out of the box right now, but that's a lot less certain.
Ubuntu ships multiple runtimes for every supported distribution and does backports FWIW.
https://docs.aws.amazon.com/elasticbeanstalk/latest/platform...
21 is supported for Amazon Linux 2023 and the JavaSE ElasticBeanstalk offering, though.
It's tied to .NET at the hip - there are no 3rd party implementations (Mono is effectively dead, correct me if I'm wrong), it's development is effectively solely driven by Microsoft, and every few years you have to rewrite all your things or get stuck on EOL versions of frameworks or abandoned tooling. The community is also vastly different in that it does not (yet) value open source and many different implementations of ideas (ie. there's an official Microsoft way to do X and that's what everyone does).
C# might be a fine language, but it's coupling to .NET and Microsoft are kind of a liability.
Java has a ton of warts, and it's not the language I'd choose today. However, it's ecosystem is FOSS-first and is immense in size and scope, has numerous options for any type of library/framework (take a loot at HTTP clients, or logging frameworks, or web frameworks, etc), and while Oracle primarily drives development they don't get the de facto final say anymore. There's also many JVM implementations and many class library implementations - all with different pro's and cons.
Perhaps .NET will get there one day. It is, after all, relatively new at FOSS/XPlat.
Surely you're not gonna say that OpenJDK and GraalVM (both owned by Oracle) is somehow an issue, would you? And Mono lives well in dotnet/runtime, serving targets like Browser WASM and iOS (until NativeAOT replaces it in full at that target, at some point).
But you're not using .NET, so no need to worry. No one is gonna pry Java from your hands, but we'll get to laugh at the choice - it is both slower in performance-oriented code and more verbose in LOB one. Pretty much the only driving reason behind choosing it is if the company is an Apache/Java shop or when a vendor offers an SDK in Java/Python/JS only due to their popularity which is a common issue in the industry.
A lot of organizations that use Java are very conservative with their tech changes, and didn't see a compelling reason to upgrade. This was especially true since Android Java still used Java 8, so many popular libraries continued to support Java 8 for their Android userbase.
That, combined with some pretty large changes in the underlying security model, mean that a lot of places have been stuck on Java 8 for a real long time. It's much harder to move from Java 8 to Java 9/10/11 in a lot of places than it is to then go from 9/10/11 to 17, for multiple overlapping tech debt cleanup reasons.