Live data from Hacker News

Java 25 officially released

mail.openjdk.org

191–200 of 260 posts

Re: Java 25 officially released

#191
post #99
post #88

Earlier quoted context omitted.

Just use OpenJDK (only downside is you have to upgrade every half year) or a distribution of another vendor (most people use Eclipse, or Red Hat if they already are Red Hats customers). It's really not as difficult as it is made out to be. If you use Oracle's distribution of the JDK then you are an enterprise customer and should have the resources to deal with their license terms.

"Am I using the correct language runtime distribution (or version thereof) so I don't get into legal trouble?" Is a question none of Java's competitors have to ask. Even using OpenJDK is a sword of damocles waiting to fall. If I forget to update OpenJDK, Oracle could come after me. It's just risk that I don't have to worry about by choosing not to go with Java. It's probably not a lot of risk, but it's risk nonethele…

That's because none of Java's competitors have commercial support offerings to begin with, as far as I know?

It's the same situation as with Linux. Red Hat Enterprise Linux isn't free. But it'd be weird if you said you're afraid of using Linux because the licensing is too complicated.

Re: Java 25 officially released

#192

(not a Java developer, no dog in this fight) I'm not sure I like the module import system very much. I think `import *`-like constructions make code a bit easier to write, but much harder to read, especially for developers new to the language / codebase. C# and Nim love that style, and it makes them almost unreadable without a good IDE. Personally, I much prefer Python's "short aliases" style, e.g. `import torch.nn.f…

> C# and Nim love that style, and it makes them almost unreadable without a good IDE. I think a lot of what turns people off to the C# developer experience is not using full-blown Visual Studio. VSCode is great but I would never open csproj or sln files using it unless I needed to manually edit their actual XML contents. It's not broadly advertised that you can buy a perpetual & fully licensed copy for $500 [0]. No s…

There is Jetbrains Rider.

Re: Java 25 officially released

#193

Earlier quoted context omitted.

In the circles I see, Java isn't popular because it's verbose and boring to use. These days I don't see those as significant issues, tbh. I would prefer a Clojure program, but I'll take Java over Typescript at this point.

> it's verbose and boring to use. Python code that follows traditional Python paradigms is called "Pythonic". Java code that follows Java paradigms is called "awful". To be fully transparent, I've never written Java professionally, only for a couple small hobby projects 10 years ago, plus some while in school, so my opinion isn't worth the pixels you're reading it on, but I look at most Java code with abject horror.…

Well, there are lots of people out there who view "Pythonic" as a euphemism for awful tbh. Throughout my career I've seen multiple large Python codebases be rewritten in Java after they turned into a mess, including - perhaps most embarrassingly - Google's internal code review tool Mondrian, which was written by Guido van Rossum himself.

One reason Java codebases feel more abstract is that they're attempting to solve problems that the scripting worlds tend to just punt on, or handle in ways that don't scale well. And because Java's type system is nominal, solutions to those problems require names.

For example, a lot of the abstraction in Java codebases is to make things deeply testable. That's what drives dependency injection, which is where a lot of BeanFactory stuff comes from. What's the Python solution to that problem? Often they just hardly have tests by the standard of Java developers! This is why Python is big in ML research where codebases are often small disposable experiments, and why after a brief era where Django was popular it sort of died off in the wider server / big data space.

Another source of complexity and abstraction is a focus on pluggable ecosystems. Databases are abstracted by JDBC, and then again by an ORM, which then might be abstracted again by Micronaut or Spring, and at each layer there are multiple competing implementations available which implement standard APIs. This kind of thing happens much less in the scripting world. The downside is that scripting codebases are far more locked-in to their choice of libraries. Porting a Java codebase from one database or ORM to another is hugely easier, because the core APIs are all standardized.

Re: Java 25 officially released

#194

Crazy that it took this long to allow parameter validation and transformation before calling super in the constructor. That was something that always bothered me because it felt so counterintuitive.

Wasn't that possible since java 22?

> Wasn't that possible since java 22?

From what I've seen, most people only care about the LTS versions of Java. Which means that after Java 21 LTS comes Java 25 LTS. The same happens with Ubuntu (after 22.04 LTS comes 24.04 LTS).

Re: Java 25 officially released

#195
post #79
post #43

Earlier quoted context omitted.

For us 8 to 17 was tough due to a lot of things you weren’t supposed to be using going away (sun packages). But TONS of libraries did it anyway. And the move from javax to jakarta for a lot of things in there was also tough. If you could get through that, you’re golden. From what I’ve seen going to 21 or 25 look easy. They’re just adding features, the big upheavals of doing the long needed cleanup are over. I expect…

The move from javax to jakarta was not really connected to the changes in the language. It is very much recommended to not do these upgrades simultaneously.

> The move from javax to jakarta was not really connected to the changes in the language.

It sort of was; it was caused by Java no longer coming with the J2EE libraries. Before that, J2EE could be considered part of Java; now that it's a separate project, they were forced to rename the packages.

Re: Java 25 officially released

#196
post #182

Earlier quoted context omitted.

> You have an IDE No, I don't. For some reason there exists a group of programmers that refuse to acknowledge use cases like "let me write a small program in nano over SSH" or "let me change one hardcoded variable and recompile the project and never touch its source code again". If your code is unreadable without IDE, it means that either IDE should be shipped with the compiler because it's an essential part of the l…

> use cases like "let me write a small program in nano over SSH" or "let me change one hardcoded variable and recompile the project and never touch its source code again". 1. This is an infinitesimally small use case 2. Often those same programmers somehow are completely fine using C++ or Rust 3. Even more often those same programmers deny the usefulness of IDEs just because they need those use cases once every 10 ye…

Bro hasn't been employed at any natsec-level project to even _try_ to suggest the first option.

Re: Java 25 officially released

#197

Earlier quoted context omitted.

I think a lot of it is the people using it and certain parts of the culture. There are a lot of Enterprise TM programmers that seem to believe as many layers of abstraction and as much verbosity as possible with little tiny methods that do practically nothing leads to better solutions. It is totally possible to write concise and pragmatic code with Java. One thing that will be a thorn in your side though is null hand…

In my opinion at this point null handling is the one remaining thing about Java that is genuinely bad technically

I haven't seen a NPE in the wild for years. We use NullAway in our build - works great.

Re: Java 25 officially released

#198
post #119
post #82

Earlier quoted context omitted.

Oracle makes me too uneasy. Can I use Java without the worry of incurring Oracle's wrath? Maybe, if I make sure I use openjdk/jump through some hoops I'll be fine. Or, I could just use any other language and not have that worry looming over me. C# is right there if I want a java-like experience without the anxiety of Oracle breaking my kneecaps. I don't know how to use java and not violate one of Oracle's EULAs. I co…

> C# is right there if I want a java-like experience without the anxiety of Oracle breaking my kneecaps. Is Microsoft really better than Oracle in that regard?

Depends. If you were there during the Steve Ballmer time then you know that Microsoft will absolutely betray you on almost every dev tech they roll out.

Otherwise C# and .NET have had a pretty solid track record.

Re: Java 25 officially released

#199

Earlier quoted context omitted.

Java's biggest risk towards continued adoption, by far, is the culture surrounding it - old Java programmers and old Java programs continue to be needlessly verbose, even if the language now has the tools (pretty much) to be as terse as other popular, modern languages. It's an uphill battle, but it might just climb the hill because it's still such a behemoth.

It all failed when .stream() appeared. Why make people use .stream() for functional programming, plus streams aren’t even reusable, I almost wish they invented a new operator based on an exotic UTF-8 character than those 9 extra characters. Fonts should have a ligature for .stream(). And now let’s talk about .collect(toList())… And records which look like ugly beans… Java is the land of the verbose. But it can probab…

It's very difficult for a language designer to satisify the aesthetes.

Re: Java 25 officially released

#200

Earlier quoted context omitted.

In the circles I see, Java isn't popular because it's verbose and boring to use. These days I don't see those as significant issues, tbh. I would prefer a Clojure program, but I'll take Java over Typescript at this point.

> it's verbose and boring to use. Python code that follows traditional Python paradigms is called "Pythonic". Java code that follows Java paradigms is called "awful". To be fully transparent, I've never written Java professionally, only for a couple small hobby projects 10 years ago, plus some while in school, so my opinion isn't worth the pixels you're reading it on, but I look at most Java code with abject horror.…

> by-product of Java's strict type system

1. Lack of first class functions till Java 8 is one reason old APIs are horrible with inheritance and reflection everywhere. You had to extend class and override methods even for simplest of tasks.

After Java 11 the code is much more succinct and functional style. But old libraries remain.

There are places where the overextensibility these libraries provide is useful. But those are few.

2. the annotation processors were late to the game - so many libraries which need to inspect object structure (such as serialization) were written with heavy use of reflection.

I will give you an example of how frameworks designed for "modern" Java look like.

Micronaut has something called Micronaut data JDBC - in which you just declare methods with few annotations eg `List queryTop10BooksByYear(int year)` and it will auto generate the JDBC + SQL code and handle injecting it into your service. The returned object can be a POJO without all the Proxy object circus ORMs come with. I haven't seen something as easy in Python yet. And all this happens in compile time with an annotation processor.

Post reply on HN