213 points mkurz 2 hours ago 162 comments

svcrunch 2 hours ago | parent

I've been using the Vector APIs for years now, and I'm still waiting for them to GA!

They are useful for neural information retrieval (RAG, memory), which relies heavily on content vectorization and similarity matching using their dot products.

taspeotis 2 hours ago | parent

Knock knock

Who's there?

long pause

Java

lazystone 2 hours ago | parent

Oh, I see, jokes from 30 years ago!

nairboon 2 hours ago | parent

And still funny today, not all jokes survive that long.

Boereck 2 hours ago | parent

Alternatively:

Knock, knock

who's there

It's the 90s, wanting their jokes back

HelloUsername 1 hour ago | parent

The long pause between the knock and the answer took 30 years

nsxwolf 2 hours ago | parent

G1 is now the default garbage collector in 27.

taspeotis 2 hours ago | parent

Sorry I only just set -xXx360NoScopexXx=4G to run that latest version without hitting OOM and you are right, it is indeed quite fast with G1.

paulddraper 1 hour ago | parent

You misunderstand, xxx360NoScopexxx is now the default.

azatom 2 hours ago | parent

It's on you bc it was (arguably but still) dead 17 years ago.

edit: don't get me wrong, i am not here to hate java, but bc i am also ... hm necrophil :)

taspeotis 2 hours ago | parent

17 years is a rookie number. Take C# auto-properties, for example: 19 years ago!

Now try asking, "When did Java get auto-properties?"

marginalia_nu 2 hours ago | parent

News at 11.

Language that runs on the explicit design philosophy of letting other languages experiment first and then incorporating their lessons learned once the dust has settled is late to implement a feature.

azatom 37 minutes ago | parent

I never cared about those kind of syntax sugars. I was happy with IDE/static checkers, lombok, mapstruct, etc.

I missed generators like that virtual threading for example.

btw: i was referring a single point when oracle bought sun and "closed java".

Betelbuddy 2 hours ago | parent

High Speed Trading team using Java looking puzzled ....

https://lmax-exchange.github.io/disruptor/

Bluestein 2 hours ago | parent

This thing is a-ma-zing. It is truly a wonder. It is something to behold. The "Disruptor" pattern.-

what_hn 1 hour ago | parent

Agentically convert to rust, get more trades faster

pohl 1 hour ago | parent

the long pause is the JVM starting up

winrid 1 hour ago | parent

Don't put a 30gb heap on m4 boxes and you'll be okay

hobo123 39 minutes ago | parent

If I'm not mistaken, OpenJ9 runtime offers some kind of precompilation and fast startup.

moomin 2 hours ago | parent

C# dev here: it’s amazing how different this is from a Microsoft release. First off, Oracle are doing versions at approximately twice the cadence. But also, and I’m guessing this is a function of the much larger Java audience: things rarely get two preview versions in a proper release. Updates in beta versions, yes, all the time. It also feels like Microsoft are bundling a lot more into the platform and leaving less to the community. Again, probably an artifact of the different sizes of the communities. Also, the page reads like an open source “We’re finished, we’re tired.” announcement rather than the razzmatazz of a Microsoft release.

theandrewbailey 2 hours ago | parent

I never thought of Java being the 'move fast ~and break things~' alternative over .NET, but Java has a faster release schedule to get features out sooner.

madduci 2 hours ago | parent

Seriously, how many are using always the latest releases of Java instead the LTS ones? With LTS ones you have ~2/3 years between the versions.

throwaway91033 1 hour ago | parent

We often use the latest version of Java at my work place. We haven't had any issues with upgrading, so there's no benefit of waiting for an LTS. There's no big process behind it either. The developers just quietly change the version as part of keeping the project up to date (BAU)

It may be that we are shielded from edge cases because we are based on Spring, which is probably the most tested piece of software before new versions of Java are released. But it's my impression that the risk of upgrading to a new version of Java is not the same today as it was in the past. The only advantage of an LTS is that it is supported longer, so that you can postpone the upgrade if you really want. It's not as if the intermediate releases are inferior or less safe.

troupo 17 minutes ago | parent

> Java has a faster release schedule to get features out sooner

While still being behind on most features?

kllrnohj 2 hours ago | parent

> First off, Oracle are doing versions at approximately twice the cadence

Is that actually a good thing?

But Oracle started playing a game, for better or worse, where they decided to couple the "language version" with a single specific runtime's release schedule. For example, in "Java 27" there are exactly 0 language changes and 1 minor feature addition to the TLS library.

Everything else is OpenJDK runtime internals which don't impact the language or how you use it. So if you don't use OpenJDK (such as if you use Oracle's other runtime, GraalVM), then Java 27 basically doesn't even exist at all. Skimming the past couple of C# releases, it doesn't look like Microsoft is playing that game, so the release cadence will of course be different.

hyperpape 2 hours ago | parent

You’re only counting JEPs, which are only for more involved features. There are lots of changes to the JDK apis that are used by other runtimes. See, for instance: https://javaalmanac.io/jdk/27/apidiff/26/.

Admittedly, the terminology here is almost designed to be maximally confusing, and I’ve never read a good post that laid out how everything relates.

kllrnohj 1 hour ago | parent

Fair, although even there I don't know if I'd call that "lots" at just 23 added or modified methods that aren't in preview

hyperpape 1 hour ago | parent

There are also bug-fixes and performance improvements that are not going to show on the page I linked.

I do think it’s plausible this is a smaller release. Not that this was the real point of the discussion, but I think it’s still just a good idea to have more than one release a year. It keeps things moving smoothly, and lowers the cost of missing a release, which has beneficial effects.

flakes 32 minutes ago | parent

I started programming when Java 6 was relatively new. Back then it was about 3-4 years in between releases. Although I don’t write much Java any more, I’m happy to see changes shipping more frequently now.

cogman10 2 hours ago | parent

There's not really a second C# runtime. Java has several, some based on the Openjdk, but a few that are completely new like OpenJ9 and Graal.

The closest C# has is mono.

This sort of thing is bound to happen with that situation. Heck, it happens with C++ whenever a new C++ version comes out. Some C++11 features took years to make their way into all the compilers.

vlovich123 1 hour ago | parent

Graal is based on OpenJDK. OpenJ9 while using a separate JVM and JIT leverage the openjdk class path as well as the build environment and various other things.

I don’t think there’s a single alternate implementation that doesn’t leverage a good chunk of openjdk somehow

pron 1 hour ago | parent

The Java language and runtime have been co-designed as a unified platform for many years now. Virtually every significant feature has language, library, and VM people working on it, and we often don't even know when we start how much of the feature would be in the language, library, or VM. Consequently, there is no "language version" or a "runtime version". There's only a platform version, which is defined in a single spec approved by the JCP (https://openjdk.org/projects/jdk/27/spec/). This also makes things easier with regards to compatibility and evolution.

kllrnohj 34 minutes ago | parent

> There's only a platform version,

And of the 4 non-preview JSRs in the Java 27 release, only 1 of them is actually part of the "platform version".

The other 3 are strictly changes to Hotspot internals with no platform involvement at all. They did not change any aspect of any Java platform in any way whatsoever. That is what I'm referring to. I'm not referring to the fact that the core library, language syntax, and runtime specs are all part of the same version. I'm referring to the fact that Hotspot specific behaviors and adjustments are also branded as being part of the platform release.

Like there's no Java 27 platform spec that says that G1 is the default garbage collector. That would of course be an absurd platform spec change. But that is still somehow a "feature" of the Java 27 release according to Oracle.

pron 11 minutes ago | parent

Right. There's a "Java SE" (platorm spec) version, and a JDK version that corresponds to it, but not everything in the JDK affects or is dictated by the spec.

BTW, Java is developed "code first", which means that we first work on the implementation in OpenJDK, and then extract the relevant spec changes from it.

> But that is still somehow a "feature" of the Java 27 release according to Oracle.

It's a feature of the OpenJDK JDK, which is, indeed, the Java implementation done by Oracle (with contributions from others). The language is very careful, as you can see in the announcement: "JDK 27, the reference implementation of Java 27". The Java SE 27 spec is here: https://www.jcp.org/en/jsr/detail?id=402

saghm 1 hour ago | parent

I didn't read the parent comment as being particularly positive in their description; it didn't sound like it was being stated as a good thing to me.

BatchJob 2 hours ago | parent

razzmatazz? Do you mean marketing lies and self aggrandizement for merely doing shoddy work?

jayd16 2 hours ago | parent

Mads Torgersen's previews and such are enjoyable and upbeat, for example.

petilon 2 hours ago | parent

> Microsoft are bundling a lot more into the platform and leaving less to the community.

This is a good thing. In Java everything has multiple community offerings, so before doing anything you have to evaluate the community offerings and decide which one to go with. If you go with the wrong one you may end up having to switch at some point, and that can be painful. This happens so often that most of the time spent when using Java is doing these evaluations and comparisons. With C# you just use the one built into .NET platform. Saves a ton of time.

throwaway91033 1 hour ago | parent

If someone wants to create a project by assembling bits and pieces from different open source products they can, but many just go for Spring (Boot) and call it a day.

All of my projects are based on Spring and I don't really have to look outside of that ecosystem. It almost acts as an aggregator of different open source solutions and often works by abstracting the functionality so that differences are not that big. I recently switched messaging providers and didn't have to change much of my code.

rwyinuse 1 hour ago | parent

Yep, with Spring Boot development is so easy, and even decade old projects are mostly easy to upgrade. I don't have experience from C# or .NET development, but at least compared to Python and especially JS ecosystems it's so much better.

hirvi74 1 hour ago | parent

> Python and especially JS ecosystems it's so much better.

That's a pretty low bar to beat.

whizzter 45 minutes ago | parent

Generally fairly painless in recent years, you need to divide the .NET timeline into original timeline ( .NET 1.0 -> Framework 4.8 ) and "core" lineage/timeline.

The Core (smaller, but also properly crossplatform) project begun in 2014, fairly major rewrites with breaking changes in the new releases up until 2019 (.NET Core 3.1) and 2020 (the 5.0 release that became the official major "unification" with most parts of Framework having newer alternatives and being "complete" even if 6.0 and 7.0 patched holes).

Projects started with core 3.0/3.1 in 2019 have a pretty easy and clear upgrade path without major breaking changes up until today.

It's not JS/Node volatility, and the cleanups in the language/runtime were well worth it in hindsight (still maintaining old 4.8 applications running under IIS), also 4.8 is still nominally supported so there's no immediate stress in upgrading (There are better semantics today, but with huge projects those semantic differences, mainly no lazy-loading by default are a risk).

PaulHoule 1 hour ago | parent

Sometimes the thing built into the .NET platform is great, sometime it is just crap but developers will use it anyway and it sets back the ecosystem.

There is this division of labor between systems programmers and application programmers and often we think systems programmers are better because they know more about algorithms and data structures and compilers and assembly language and such. On the other hand, application developers understand how to reconcile the mental model of managers and employees and customers with computers, reality and common sense and, once they get experienced, see the commonalities between all the run-of-the-mill bizapps that we are coding all the time.

Application programmers do a lot better at applications framework than systems programmers and make things like Ruby on Rails and Spring. Systems programmers make terrible things like ASP.NET MVC (I worked out a way to do MVC with ordinary ASP.NET, why couldn't they, with access to the platform internals?)

bob1029 11 minutes ago | parent

> If you go with the wrong one you may end up having to switch at some point, and that can be painful.

https://en.wikipedia.org/wiki/Log4Shell

https://learn.microsoft.com/en-us/dotnet/core/install/window...

Phelinofist 2 hours ago | parent

> Also, the page reads like an open source “We’re finished, we’re tired.”

I mean it's short and concise and there are additional resources that provide more detail. IMHO it's not a bad thing.

Betelbuddy 2 hours ago | parent

>> Oracle are doing versions at approximately twice the cadence.

This has nothing to do with Oracle. All good that you hear from Java in the last few years, is the great community and good old people from Sun working at Oracle.

grodriguez100 1 hour ago | parent

“The good old people from Sun working at Oracle” is now Oracle as well.

GrumpyGoblin 52 minutes ago | parent

Someone doesn't know their Java history. Oracle bought Java 16 years ago in 2010. At that time Sun had been working on Java 7 for over 4 years with no release date in sight. Oracle trimmed the fat and released Java 7 in less than a year. And since then has kept a regular release cadence. Sun would probably still be working on Java 7.

hirvi74 1 hour ago | parent

I kind of wish C# would slowdown releases in some areas. I have not been a huge fan of some of the changes in the past year. I love the performance changes and bits of functionality here and there, but the syntax-sugar is getting annoying.

kittoes 1 hour ago | parent

Interesting take, how is optional functionality annoying? Isn't the fact that it's just sugar a huge benefit? Us old timers can simply stick to what we're familiar with.

pjc50 1 hour ago | parent

I don't get this either. You can even lock the language level if you really don't want it, or you can just ignore it.

fourseventy 1 hour ago | parent

Because unless you are the only person maintaining your codebase other people in your organization will start using the cool new syntax sugar and optional functionality. So you will be forced to deal with it as it starts showing up in your codebase.

ygra 1 hour ago | parent

You don't really have to use the latest C# version, though. Install the latest .NET and you get the performance improvements without usually having to change anything about your code.

whizzter 41 minutes ago | parent

People complain, but most of the actually used changes are in things that continually used where I find painpoints.

Not 100% on board with the collection expression changes (I found fluent Linq chains usually more readable), but they're improving painpoints so I think it'll work out in the end hopefully.

tancop 39 minutes ago | parent

Most new syntax features make code more readable. For those that don't there are company style guides and `AGENTS.md`. The C++ philosophy comes down to "if it works ship it" and I don't think you're expected to use every single new feature.

32oqa9 1 hour ago | parent

It's a normal open source announcement without the corporate bullshit. No fatigue. No doom. Just facts! /s

derefr 6 minutes ago | parent

> Also, the page reads like an open source “We’re finished, we’re tired.” announcement rather than the razzmatazz of a Microsoft release.

I think this is because the JRE/JDK upstream releases are a bit like Linux kernel releases: all the major first-party feature development goes on in subprojects that maintain their own "living forks" during feature development, with the teams on these features doing PRs against the fork's own "main"; that "fork's main" having its own subproject maintainers who ensure a mess isn't made of it; and then those maintainers eventually polishing up that fork-main into a single big one-shot PR to upstream once the feature-as-a-whole is ready.

(Compare/contrast: the Linux kernel's mm, rt, and kvm feature development efforts.)

Because of this, the top-level "project maintainers" (i.e. the people who decide what gets merged into upstream main) aren't really the same people as these subproject people who care deeply about these new features. They want to ship stuff people want, but they personally mostly deal all day with requests to merge 1. small bugfixes, and 2. features so small that no JEP is needed.

But then, every once in a while, they have to deal with a request to merge one of these huge subproject upstreaming PRs. And sure, it's already heavily reviewed by the subproject's maintainers, who they trust. But they do still have to audit it and learn it and create a stabilized release path for it. "Handover" stuff. And that's tiring!

So, given that the toplevel project maintainers write the release notes, I'm not surprised they come off as weary about releases.

(That being said, for purely PR reasons, the toplevel maintainers could ask the subproject staff to contribute their perspective to the release notes of a release that merges their work? But this could also just-as-well be a separate blog post—which would probably be better for sharing. I don't think I've ever seen a centralized Java blog [is there one?] but I think the subproject teams do tend to have them.)

aaronax 2 hours ago | parent

"The Java Story" documentary by CultRepo on YouTube is pretty great. A major topic is the release cadence which some other comments here are mentioning / joking about.

arein3 2 hours ago | parent

Project Valhalla will go into Java 28 (next year, and preview version).

Fingers crossed I'll manage to use null type safety in my lifetime.

karussell 2 hours ago | parent

A first step of Valhalla that is ...

rf15 2 hours ago | parent

universal null type safety has sadly been discarded as a core concept of Valhalla in my Understanding; that being said, the proposals in Valhalla have null-safety as a side effect, but only under certain conditions.

MrBuddyCasino 1 hour ago | parent

When (if) null safety ships, I‘m not sure I can justify using Kotlin any longer.

Java simply got too nice.

hn8726 1 hour ago | parent

Multiplatform and Compose come to mind as Kotlin differentiators. I agree rest of the language actually slowly falls behind

pregnenolone 1 hour ago | parent

> Project Valhalla will go into Java 28

Unfortunatley without specialized generics and without the performance benefits that are supposed to come with it. They were too slow with Valhalla.

brabel 37 minutes ago | parent

You really need to dare to try something else, Kotlin has been available for many years and the cost for a Java shop is super small since the same tools work with both. I’ve used also Dart which is lots of fun. Even Typescript can be a good alternative depending on what you’re doing. All have nullability guarantees and a nicer type system than Java while being in the same ballpark in terms of performance.

rf15 2 hours ago | parent

> Twelfth Incubator

Are you sure this egg is actually viable?

I mean, I'd love to see it, but...

papercrane 1 hour ago | parent

The JDK team made a decision awhile ago to hold the Vector API until value types are final. That's why the API has been incubating so long.

Horffupolde 2 hours ago | parent

Serious question: when should one use Java for greenfield projects in 2026?

kllrnohj 2 hours ago | parent

When you think a garbage collected language is a good fit for whatever you're building?

kfir 2 hours ago | parent

Wouldn't you go with golang in that case?

topbanana 2 hours ago | parent

I would, or C#

ndriscoll 2 hours ago | parent

Golang gives you none of nice features of a modern language while being about the same performance tier as Scala or Java, so there's basically no reason not to use Scala.

eklavya 2 hours ago | parent

I ported a moderate sized java project to golang. Test suite runs order of magnitude faster now. There isn't much change in terms of the architecture. Pretty much the same algos and data structures. The whole dev tooling runs on a 16 gb mac without swapping now. I used vs code for both

ndriscoll 1 hour ago | parent

IME they're both in a place where Rust is maybe ~40% faster for a decent CRUD web application server, but with go you need to write much lower level code to get there (e.g. using composable generic iterators will ruin your allocations, so it's all manual for loops). You can write idiomatic high level Scala and get the same performance. Which could be as simple as the go compiler offers no ability to force inlining and has way too low of a complexity threshold, but that basically makes reusable code unusable in high performance situations.

The whole go team's philosophy tends to also revolve around assuming their users don't know what they're doing, which is annoying. Like an inline keyword: thinking you know better than me doesn't mean I'm not going to inline it; it means I'm going to manually write it inline myself in the code, and then think the language sucks because it's tedious, error-prone, and verbose. Or they tend to mark lots of stuff private for no reason, and e.g. with TLS 1.3 they just ignore your config because they think they know better, etc.

jeffbee 5 minutes ago | parent

Isn't this mostly about java cold start costs? It might be that other people are optimizing for steady-state performance, not transient startup performance.

Thaxll 2 hours ago | parent

Golang is faster and use way less memory than Java, never wonder why you never see Kubernetes controller / sidecar is Java?

As for Scala it's pretty much a dead language, no one work with it and it's impossible to find dev for it.

10 years ago I was moving Scala code back to regular Java.

weego 1 hour ago | parent

It's sad - I spent a good 12 years writing Scala every day and it was the ideal language for my brain. Until it wasn't - sbt got too complex for it's own good, everything became "very smart" developers over-using implicit conversions, you couldn't find a project that wasn't an opinion war on cats vs whatever. It collapsed on the weight of it's own smugness.

go and kotlin aren't it, gleam scratches the itch but I can't justify writing code that would impossible to hire for.

scala situation is a real shame.

ndriscoll 1 hour ago | parent

Every job I've has has used different languages so I don't really understand the need to find a dev for a specific language. I went from network firmware in C to banking application servers in Scala and it took like 2 weeks to ramp up. Not a big deal. Now I write lower level networking stuff again in Go, which seems like its just worse than e.g. C-with-templates (and occasional classes) style C++ so I don't really understand why people like it.

I think it used to be common to just look for smart people and assume they can run with whatever stack. Wasn't that the point of abstract algorithm questions etc. (basically an IQ test)?

jeffbee 7 minutes ago | parent

Java is almost always significantly faster than Go because the Go runtime does a poor job of exploiting large memory page, doesn't support text-on-huge-pages, and barely supports profile-guided optimization. With HotSpot you get all of this and more for free. Go is fine but Java is peak.

pron 1 hour ago | parent

You could, but it's not as fast as Java, especially under heavy workloads, its telemetry is nowhere near as good, and it's much less popular.

dorkypunk 2 hours ago | parent

When you are already familiar with it or work in a Java shop, there are better options if you are starting from scratch, but if you already have 50 guys that know Java it's a pretty big ask for all of them to switch.

doublepg23 1 hour ago | parent

Why not Kotlin?

dorkypunk 58 minutes ago | parent

Most organizations that use Java tend to be pretty conservative with their technology picks and nowadays with newer Java versions the only real gap with Kotlin is null-safety which is supposed to also come to Java at some point. There is also an organization culture component most of the time, one our engineers actually proposed to use Kotlin for one of the new projects but it got rejected because "We are a Java shop"

doublepg23 10 minutes ago | parent

Are you guys keeping up with the Java LTS releases?

mikert89 35 minutes ago | parent

I think Java took all the best features of kotlin

orangesilk 2 hours ago | parent

Jruby is nice - runs Ruby on a Java Virtual Machine with full concurrency and Ahead Of Time compilation

topbanana 2 hours ago | parent

When you work at a Java shop. Kotlin is much nicer if you have to run on the JVM but aren't restricted to Java.

t0mas88 2 hours ago | parent

When building boring web applications with a sizeable team that need to run for a long time. Hiring developers is easy since there are many, there is nearly no magic and the language is quite strict and type safe so it works well with a large team.

And that "team" nowadays may also consist of many AI agents. In my experience Claude Code for example works very well with a typed, slightly boring language with lots of framework and library support. Because it doesn't compile when you get something wrong, instead of getting a vague runtime issue that Claude can't always see.

BoppreH 2 hours ago | parent

> there is nearly no magic

I agree with the rest, but there's definitely a lot of magic in Java. This is from both what features the languages makes available (many) and how the community uses them (often). I've had so many hard-to-debug issues in Java over the years due to reflection, annotations, and bytecode manipulation shenanigans.

And another positive point for Java: checked exceptions. It's verbose, but knowing exactly in which ways a function can fail is extremely helpful for building robust applications.

msluyter 1 hour ago | parent

I haven't really been in the java space for a while now, but I recall there being a fair bit of criticism[1][2] of checked exceptions over the years.

[1] https://www.javacodegeeks.com/2026/01/javas-checked-exceptio...

[2] https://reflectoring.io/do-not-use-checked-exceptions/

WRT magic, I've generally thought that was a result of frameworks - Spring, for example. In the past, my feeling was that these impose a sort of meta/configuration language that itself is not checkable at compile time, so you'd get weird runtime errors that are somewhat inexplicable. This was like... 2018 though, so perhaps things have improved.

voidfunc 1 hour ago | parent

Checked exceptions are controversial mostly because a lot of the core APIs use them in places where it's pointless to check, like IOException.

Using them correctly can be great tho.

PaulHoule 1 hour ago | parent

Mostly I think they are a mistake, like in ordinary application code instead of catching close to the throw you want to do a lot of

  try {
     ...
  } finally() {
     ...
  }
to make sure things get torn down that have to be torn down and let the exception go to the top of the unit of work and probably to whatever drives the work unit. You can probably do better than logging the raw exception and moving on to the next work unit but you can do much worse. That is, you want a default "sloppy" error handling approach that's correct that you can do without thinking and avoid other kinds of "sloppy" coding encouraged by checked exception such as catching exceptions locally without doing the right thing globally.

Occasionally though I have built something really sensitive, like an authentication filter for a web site which has at least 5 ways to log in and in that I have a hierarchy of exceptions and use checked exceptions heavily to document all the ways things can go wrong and felt like "the type system really has my back here" but that is like 5% of the Java I write.

ndriscoll 1 hour ago | parent

Scala's ZIO also demonstrates that they're a great idea and can be perfectly ergonomic, but you need type inference, which Java devs were resistant to for a long time (maybe still are? I remember lots of "how will I ever know what `val a = new Animal()` is???"). If you infer the exception type, they're basically invisible except for when you forget to have some place in your program to handle them, which is exactly what you want.

dmux 53 minutes ago | parent

>in places where it's pointless to check, like IOException

Can you explain why this is pointless? In my mind, this being a checked exception would hopefully be a hint that I should think about this failure-case and make an explicit decision whether to handle it or not. Network connection failed? Maybe I retry. Maybe I store that data somewhere else as a fall back. Isn't this similar to Go programmers needing to check if err is not nil?

mrkeen 35 minutes ago | parent

I don't think I can recall a time where I routed-around-the-damage on the basis of a particular typed exception.

As soon as you consider retrying a network failure, you immediately need to start thinking about distributed systems failures, idempotency, and all that good stuff.

As soon as you start thinking about the above, it becomes immediately obvious that low-level calls should not be able to decide to re-run themselves.

BoppreH 1 hour ago | parent

I'd argue that checked exceptions are still worth it, even though all the problems pointed out do exist. And that's because it works to inform consumers of what a producer is doing. Haskell has the IO and Maybe monads; Java communicates the same information through IOException and other domain exceptions.

Many times I've decided to switch from one function to another, or even an entirely new library, because the checked exceptions told me that it was doing far more than I expected, and I was not comfortable introducing those new failure modes.

It's far from perfect, one still has to handle nulls and wrapped/merged exceptions, but overall I like this language feature.

theandrewbailey 1 hour ago | parent

> but knowing exactly in which ways a function can fail is extremely helpful for building robust applications

I've worked on Java apps that have failed in mysterious ways that no exception could explain. Meanwhile, the overhead of having to call out certain exceptions but not others in language syntax is a bit excessive.

For example, decoding a byte array (or URL encoded form field) into a UTF-8 string means handling a theoretical UnsupportedEncodingException. What the fuck? How the hell can one have a JVM that doesn't support UTF-8? Why does my code need boilerplate that will never run because there might be some broken-ass JVM out there that that doesn't support UTF-8? How did it launch a web server, safely load all the libraries, and accept a web request, and route it to my code without blowing up? "But the encoding scheme might change..." No, it won't change. It's always going to be UTF-8. It will always be UTF-8. If it's not, let it blow up.

Horffupolde 1 hour ago | parent

Perhaps you are the trip you expected to blow up first.

kccqzy 1 hour ago | parent

A lot of that is coding style. I’ve also seen a lot of hard-to-debug issues in Python caused by reflection, weird decorators that muck around with name-mangled symbols, and bytecode manipulation. You can even manipulate the traceback object so it’s more difficult to make sense of why the exception comes from.

It took me quite a long time to accept that the recommended unit testing library manipulates bytecode so that the exception message for `assert a == b` prints the values for both.

cavoirom 1 hour ago | parent

I agree, to name a few:

- Annotation processing: if you know Lombok, MapStruct.

- Class loader.

- Reflection.

- Garbage collection.

pmontra 19 minutes ago | parent

It works well enough with plain Ruby and plain Javascript. It ported a Rails 7, Vue 2, vuetify 2, vuex app to Rails 8 (ok, easy, I did it myself at least once), Vue 3, Vuetify 4, Pinia. I had to visually check the SPA, of course.

marginalia_nu 2 hours ago | parent

Not at all a bad choice.

It's stable to the point of boring, and there's no shortage of people who know the language and can work with it, it's got best in class tooling, decades worth of libraries almost all very mature. Most of the language's issues are from legacy code bases coded in a style that isn't really relevant to a greenfield project.

gentlewater 1 hour ago | parent

It’s still missing null safety, right? Which means it’s still a hard no for me.

marginalia_nu 1 hour ago | parent

Have you tried not returning null or constructing incomplete objects?

gentlewater 1 hour ago | parent

Can I trust code I’ve written myself with no guarantees from the language? Maybe. Can I trust code written by dozens of other developers (and/or agents) working on the same project over multiple years? Definitely not.

marginalia_nu 1 hour ago | parent

Why don't you have any coding standards? If you're working with agents in particular, catching and enforcing this stuff should be easier than ever.

saghm 1 hour ago | parent

Most engineers do not have the ability to impose rules by fiat on all of their coworkers. It seems like you're misunderstanding the nature of working on a codebase as an IC when other developers contribute to it. If all of my coworkers don't want a lint rule I propose, I don't get to add it. If all of my other coworkers want to write code in a certain way and approve each other's MRs with code written in that way, I don't get to veto it.

ndriscoll 1 hour ago | parent

Most engineers don't get to decide to use a language either. Usually someone with the clout to pick a language has the clout to set style requirements too.

gjadi 52 minutes ago | parent

Null Analysis can be checked and enforced by the CI.

saghm 1 hour ago | parent

Do you never use external libraries?

what_hn 1 hour ago | parent

With agents, we're getting there.

saghm 1 hour ago | parent

I admit I haven't worked in Java for years, but no project I've seen at my current company (the only one I've worked at since agents have been a useful thing) is anywhere close to removing all dependencies. From what I've seen, people want to spend tokens on new things, not things that are already known to exist. Even if you can reinvent the wheel, it's not something that an employer is going to be particularly happy to subsidize.

mrkeen 42 minutes ago | parent

The standard library writers can go first.

LelouBil 1 hour ago | parent

You can either use Kotlin then, or simply use java and nullability annotations, they have good support in both IDEs and analysis tools

gentlewater 1 hour ago | parent

I use Kotlin as my main language and I’m very satisfied with it.

well_ackshually 1 hour ago | parent

Any serious project will be using NullAway and annotating everything (or, indeed, using Kotlin).

Otherwise, yeah, you're still in for a world of pain.

winrid 1 hour ago | parent

I have a couple 50k+ loc java projects written entirely by LLMs at this point that have never thrown an NPE.

what_hn 1 hour ago | parent

Same here with go, then Again go doesn't throw!

xdavidliu 33 minutes ago | parent

surely 'throw a npe' means something very similar to something that Go does

msgilligan 55 minutes ago | parent

The ecosystem has (at long last) standardized on JSpecify (https://jspecify.dev) for nullability annotations. JSpecify allows you to annotate a package or module with `@NullMarked` and your IDE and build (via ErrorProne+NullAway, typically) will check for null safety.

If you develop a library in Java and use it from Kotlin, the built-in Kotlin null-safety will recognize the JSpecify annotations on the library.

Null-restricted types are on the roadmap. See: https://openjdk.org/jeps/8303099

wavemode 55 minutes ago | parent

Nullability annotations + tooling makes this a non-issue in practice.

misiek08 37 minutes ago | parent

I’m not sure how long it will take, but please - can we stop saying that annotations like @IHopeThisWontBeNull is a toy for kids and, having so many years of incidents caused by those and having LLMs to write and fix the code, we can rely on language and compiler already?

wavemode 22 minutes ago | parent

You're drawing a distinction that doesn't matter in practice. If you encounter a NullPointerException incident then you either didn't annotate your code or you didn't run the tooling. (In fact before even running your CI suite, any serious IDE will tell you immediately that you've mishandled null somewhere.)

I get that some people feel like it ought to be built-in to the language rather than a separate tool... but people's personal feelings are irrelevant to the lived experience of my day-to-day work, where worrying about null is truly a thing of the past.

ivan_gammel 53 minutes ago | parent

It is really not a big deal nowadays, the problem of the same scale as having index out of bounds error (no language has good defence against this, yet it is not a catastrophe).

pmontra 27 minutes ago | parent

That's expected (the index out of bound). You have an array, and maybe it grows, you read a number from input, you don't check it against the size of the array because you want to torture the language, use it to get the element at that index and... I'm sure that there is a surprisingly number of different designs of what it should happen and a number of designed ways to ensure that it doesn't happen. But a runtime error is expected.

ivan_gammel 2 minutes ago | parent

yes, so are the NPEs - both are runtime errors indicating a bug in the code. NPE was a major source of irritation 20 years ago, but what many people do not know is that debugging NPEs in Java is easier now - they carry more information about the source. And the culture has evolved.

foolfoolz 2 hours ago | parent

java is a great language for server side projects. it is actively maintained, the biggest issues with it have JEPs, and it’s very friendly to AI authors

soco 2 hours ago | parent

Whoever works with, or chooses Java, is not doing it for the language itself, be it beautiful or not. Java has a huge ecosystem, from battle tested integrations to optimized images to build pipelines to whatever, so at the same you're buying access to all this world (yes, more than an environment). And of course transferable skills. I'm not saying Java is alone offering this, also not saying every feature is the best, but you can have them all, and even choose from different options.

marcosdumay 1 hour ago | parent

Java's ecosystem is lingering since Oracle brought the language, and it's at the point where you should really look if the things you want to use are still in the state of the art, or if they felt behind every other language.

And if you are starting from scratch, whatever part of the ecosystem you use, I'm not optimist on its situation improving with time.

rzmmm 1 hour ago | parent

I use Java for hobby projects, I think it's design choices make it a nice minimalist language for "classic OOP" style: dynamic dispatch, encapsulation etc.

Nowadays a lot of code is written with mostly procedural style with some functional characteristics, I wouldn't use Java for that.

skeletal88 1 hour ago | parent

Same question for .net or C#

Why should anyone use it over Java? Ms is hostile towards its developers, it creates new versions of things, deprecates previous versions, uses confusing naming for newer versions.. etc.

hirvi74 1 hour ago | parent

Because your employer is dick-deep in Microsoft psychosis.

I've been a .NET dev for a decade now. It's perfectly serviceable, but I wouldn't say I truly love the language anymore, but I would take it over Java any day. Entity Framework and LINQ are gifts from the Gods. I have never used an ORM that even comes remotely close.

Also, C# is big in the gaming world. I am working on a game right now, and I was not impressed with what many other languages had to offer. It seems like the kings are still C(++) and C#. Of course, Java can create games, but I would argue that is a "could vs. should" kind of decision.

Unity, Godot, Monogame, Raylib, XNA, FNA, etc. all can use or rely on C#. I have not seen Java be compatible with any of those -- except maybe Raylib? I do not know of anyone nor any games that use it though.

bitgeist 1 hour ago | parent

Microsoft has come a long way since Satya Nadella took over in early 2014. The open-sourcing of .NET Core that same year was a huge step forward. Seeing a 'Microsoft Loves Linux' slide that year was something I did not have on my bingo card. VS Code and the GitHub acquisition demonstrated Microsoft's interest in fostering good relations with developers instead of alienating them. I do wish GitHub had stayed independent, though.

Microsoft is a business and will always put their business objectives first. In my opinion, they have a non-zero amount of evilness. I do not support them jamming Copilot into every available crevice. I still think they make dumb choices, like every imperfect organization. However, C# is a powerful and intuitive language, and for Microsoft shops that already run a lot of Windows and SQL Server it makes a lot of sense.

No shade to the JVM. I've mostly enjoyed my time in that space. I do believe the choice between Java and Kotlin, the wide variety of vendor JDK distributions and IDE fragmentation make the JVM stack a bit more difficult for newcomers to break into.

tester756 49 minutes ago | parent

Consistent ecosystem with state of the art tooling (Visual Studio)

Majority of things provided from MS instead of having to rely on 3rd party, especially nowadays when supply-chain issues are huge concern

rwyinuse 1 hour ago | parent

Java & Spring is a good choice whenever you want your application to work and be maintainable 10 years from now, without having to replace the framework and half of the libraries you used. I see few good reasons to ever use something with unstable ecosystem (like Javascript with NodeJS) over Java these days.

ulimn 1 hour ago | parent

Not just the time, but the environment, the OS as well. Where you can run JVM, there's a pretty good chance you can run your app.

cavoirom 1 hour ago | parent

If your app requires a specific JDK version and your OS wont support, you can run that JDK version in a modern JVM: https://www.graalvm.org/latest/reference-manual/espresso/

jjice 1 hour ago | parent

Stability is a good point, although I am curious where JS and Node stand there now. They're not at the level of Java or .NET by any means, but the JS ecosystem has definitely begun to slowdown over the last few years. I've used express for the server and winston for logging for years and years now and they've very stable at this point.

I guess I'm asking this as an open question: Where are we in the "move fast vs stable" spectrum with Node these days? Definitely not rock solid, but it's moving in that direction I feel.

eranation 1 hour ago | parent

I wrote about it 13 years ago, some of it still stands true. https://news.ycombinator.com/item?id=5857495

pron 1 hour ago | parent

These days, Java is mostly used in greenfield software that has to be very reliable, very performant, and last for many years. So it's often the first choice for banking, telecom, finance, government, defence, manufacturing control, logistics and shipping, media streaming, retail, hospitality, healthcare etc.. It's usually not a first pick for more exciting software, such as Python type checkers, JS bundlers, or TUI file managers.

astrodust 1 hour ago | parent

Why not Go, Rust, or C#?

pron 1 hour ago | parent

They lack in performance, stability (compatibility), observability (telemetry), productivity, or some combination thereof. They are chosen, of course (especially C#; Go and Rust are far behind), but not as much as Java.

brabel 49 minutes ago | parent

I think you have a biased view. The number of stuff written in Rust in the last couple of years has absolutely exploded. For example, I see a lot of projects now that provide SDKs in Rust but don’t bother with Java. And I say this as someone who still writes most of my code ( or tell my LLM to write) in Java.

pron 37 minutes ago | parent

There's a difference between number of programs and number of LOC (the latter is related to the number of people involved). I am not aware of any SDK targeting the industries I mentioned that "doesn't bother with Java". It's not only a popular choice in those industries, it's not only among the top choices, but it's the top choice by a large margin. Look at wanted ads in those industries to see that. Overall, there are only two languages as popular as Java or more, and they are JS and Python: https://www.devjobsscanner.com/blog/top-8-most-demanded-prog...

Mawr 27 minutes ago | parent

Yeah I mean he literally works on Java at Oracle, so may just be a little biased.

Doesn't bother to disclose it of course, because what, you don't check everyone's profile in every discussion to make sure they're not biased? What, you don't just know who every user on this site works for? You dummy you :)

pron 25 minutes ago | parent

It's disclosed right there in my profile (I don't see your professional affiliation disclosed in your comment; or your profile, for that matter). Of course, I, like other runtime and compiler people, joined the Java team because we wanted to work on the most advanced compiler and runtime tech. I perfectly understand people who want to work on smaller, newer, potentially insurgent products, but I took the chance to work on the cutting edge of compiler and runtime engineering, and Java is where it's at these days (I'm not saying it's the only one, but it's a very small club).

akkad33 38 minutes ago | parent

I don't agree. If anything these newer languages have better tooling and new projects are always built from ground up to support open standards like open telemetry

pron 31 minutes ago | parent

Open telemetry is about how telemetry data is reported, not how it's collected. It's hard to compete with JFR on the breadth and depth of low-overhead, in production telemetry, built into the standard library and the JVM itself.

misiek08 32 minutes ago | parent

Saying that Go lacks in those is just showing how people are making software those days. It’s just terrifying.

As to Rust - we all, hopefully, agree that it’s great language, but not for some startup making websites or Mongo based, boring backends. It’s great for the stable, system level products.

pron 28 minutes ago | parent

I don't know what compiler and GC quality has to do with how people are making software these days, and I don't think state-of-the-art optimising compilers and GCs are terrifying at all. Go opts for more traditional, simpler algorithms under the assumption that for many purposes they're good enough. That may be so, but sometimes workloads really are very demanding.

Almondsetat 1 hour ago | parent

Go and Rust have much worse tooling for enterprise-level collaboration

doublepg23 1 hour ago | parent

Do they?

It felt like every dev that worked on our Java behemoth at a previous job was elated to switch to Go.

akkad33 19 minutes ago | parent

I don't think they do. I work in a maven shop and half of the people don't even know what to do when maven fails inexplicably

throwaway91033 1 hour ago | parent

I think of Java/Kotlin and Spring as a secret weapon for startups. My workplace was a startup 5 years ago and it's amazing how things just worked as expected, leaving us more time to focus on the product. We have tried a few alternatives over the years, such as a few services in Rust, but the people who implemented those have usually seen the advantage of using a stable ecosystem after a few years. It's unfortunately something you need to experience yourself instead of being told by someone else.

pjc50 1 hour ago | parent

JavaFX is fairly high up for "I want to run the same UI on Mac and Windows, and I don't want it to be an Electron web app in a box".

whartung 22 minutes ago | parent

JavaFX is a hidden gem. I really like the programming model with its binding and scene graph and CSS.

It's not as portable as Swing, as it has some platform specific binary components to it. But it works fine on mainstream platforms. For me Swing portability is not worth giving up the FX model.

Just be aware that if you happen to bundle in the Web view component, you're basically adding WebKit to your distribution. I did this with a small project because I wanted to have a "help" screen with Markdown -> HTML. Easy, but "expensive". It simply adds a big chunk (10-20Mb) to your distribution.

(Now I have a very crude Markdown renderer for this task, which is a 100 lines code, and I'm working on a better one -- but I have yet to pull the trigger on the latest FX with its new Rich Text component, which could change everything.)

One hot tip with cross platform FX, however. Embed your fonts. The font suite is not common across the distributions, and the CSS does not honor the font fall back (i.e. if not XXX font, then YYY font), so if the runtime doesn't have your specific font, it collapses to the System font. So, embedding the fonts you use helps a lot with cross platform stability. Plenty of free fonts, I have not had a real problem with this. But it can be one of those O.o moments when you test on other platforms and encounter it the first time.

nonethewiser 1 hour ago | parent

Here is a niche one:

When you want to make a game and support modding with pretty much zero development effort.

pie_flavor 57 minutes ago | parent

Java-the-language blows, but Kotlin does not, and Java-the-platform is on the Pareto frontier of oldest-yet-most-usable open-source ecosystems. I prefer Rust, and the gaps where it doesn't apply, C# fits my use cases better, but Kotlin/JVM is a rock solid development platform.

hobo123 43 minutes ago | parent

I once tried Kotlin for a pet project, but after a while switched it back to Java, since it's good enough, IDE support is better, it's much faster.

I guess if you use/like Intellij it's ok.

DanielHB 45 minutes ago | parent

Java and C# seem to be the best ways of making code-first OpenAPI based servers.

C# LINQ also seem to be the best compromise between ORM and raw SQL queries, although I never used it myself.

I have been severely disappointed in all similar solutions for Go at least and I imagine Rust does not have something better given it has a smaller community-base.

Python and NodeJS have some very neat solutions for this stuff too, but both are "slow" dynamic languages. I personally dislike python with a passion and NodeJS stuff is extremely community-driven and therefor often unreliable. Prisma (NodeJS ORM) for example just did a major overhaul and is now pushing a completely different API.

If you are making boring REST API to SQL Database it seems like Java and C# are the best options.

mikert89 36 minutes ago | parent

When you’ll have tons of low skilled devs contributing to an important but boring application that will last a while

pineappletooth_ 20 minutes ago | parent

Still pretty fun that here banks are still using Java 8, where i work they use java 17 and you can still find work requirements asking for java 7 (mostly in goverment entities)