Live data from Hacker News

Java 26 is here

hanno.codes

231–240 of 352 posts

Re: Java 26 is here

#231
post #220
post #53

Earlier quoted context omitted.

After ~13 years of working with C#, I moved to Kotlin. It's such a beautiful language. When I have to read docs for a Java lib I realize why I like Kotlin. I want to say culture around Java doesn't have to change, new culture is growing around succinctness (if not simplicity) of Kotlin, and it gets most of the benefits of Java ecosystem.

I also like Kotlin. The readability is awesome. ;) inline fun Any?.cryptic() = (this as? T)?.let { it::class.simpleName?.also(::println) } ?: Unit

I get the snark, but also - there is this "ideal Java code style" that most experienced devs tend towards. Unfortunately I don't see anything like that for Kotlin (yet?), and there are a bunch of patterns that I really dislike. I sometimes feel people just toy around, like "wow I can make this into an extension method, how cool" and leave that as the code.

In general, I really dislike extension methods, especially when paired with tiny objects with barely any functionality to begin with. Like people build a mental model of what a thing is based on how can it be used - but if you leave that empty and put every behavior at different files in the form of extension methods you make this understanding very hard to build up.

Add to it that it removes polymorphism and often actually hinders readability.. so my point is, having more ways to write code is not necessarily a positive.

Re: Java 26 is here

#232
post #83
post #67

Earlier quoted context omitted.

If someone reads this and wonders what JBoss is, the contemporary variety is called WildFly and it is actually rather easy to install and play around with. https://www.wildfly.org/ I think this is an often overlooked solution to some of the problems we nowadays tend to approach the clown for. As for build systems, Maven is old and cranky but if something else replaces it, it will probably be quite similar anyway.

> As for build systems, Maven is old and cranky but if something else replaces it, it will probably be quite similar anyway. Bazel is the most obvious contender and very different from Maven in almost every possible way.

Not really, no. It is similar but worse than Maven in that it requires quite a bit of time investment to configure, and shares the drawback of Gradle that it is configured in a programming language instead of a configuration language.

Switching out Maven for a larger maintenance burden might be reasonable in a large organisation that is swimming in competent employees, but most do not.

As for obvious contender, I'd say that would be Gradle, which is harder to get someone started with than Maven and due to the DSL allows you to invent weirder footguns.

Re: Java 26 is here

#233
post #172
post #67

Earlier quoted context omitted.

If someone reads this and wonders what JBoss is, the contemporary variety is called WildFly and it is actually rather easy to install and play around with. https://www.wildfly.org/ I think this is an often overlooked solution to some of the problems we nowadays tend to approach the clown for. As for build systems, Maven is old and cranky but if something else replaces it, it will probably be quite similar anyway.

Yep, I'm using JBoss as a catch-all for older "big-iron" style Application Servers - modern Jakarta EE (10 onwards) is much more slimmed down, and a solid option. unsure re Maven, 4.0.0 has been around the corner for years, but I think there is space for a modern alternative that is JPMS first, supports semantic versioning (i.e. tilde/carat notation) with lockfiles, and doesn't require a bunch of plugins out of the b…

Mill looks kind of nice on the surface but I haven't seen it in action in any serious project. I suspect the flexible DSL might come with a maintenance burden.

XML is nice, if your pom.xml is massive, just suck it in through JAXB and program against it, perhaps render it to a web page. XSLT can also be helpful. We're not supposed to look at XML as plain text.

Re: Java 26 is here

#234
post #67

Earlier quoted context omitted.

If someone reads this and wonders what JBoss is, the contemporary variety is called WildFly and it is actually rather easy to install and play around with. https://www.wildfly.org/ I think this is an often overlooked solution to some of the problems we nowadays tend to approach the clown for. As for build systems, Maven is old and cranky but if something else replaces it, it will probably be quite similar anyway.

JBoss was great back in the day. I remember when there was a JRuby port of it called Torquebox that I loved. Eventually though, I found Elixir and it gave me everything I was looking for from that stack.

Yeah, same, but Elixir gigs aren't as common as Java gigs. However, if one ends up in a Java role, chances are that Elixir would be a good porting target for the systems since it typically can replicate the architecture but with less fuss and has pretty good support for interfacing with Java.

Re: Java 26 is here

#235
post #176

Earlier quoted context omitted.

Having used micronaut for a few years now, I hate it. Maybe it's innate to trying to use a a fully fledged server-style framework in a serverless context, but I don't think it's suitable. In fact I think the whole idea ("Hey, let's bludgeon spring-like metaphors into an entirely new setting") was a poor one. Java itself I've enjoyed more and more over time as the language has evolved into something much more expressi…

It was a while back (when I was a worse programmer) I found both Micronaut and Quarkus dev experience more palatable than spring. what did you dislike? Pervasive DI? Annotations? configuration mess?

Never done much Spring, so I don't have a lot to compare to. But ...

I'm not a massive fan of using annotations in concept, because they obfuscate what's taking place. Unlike in (say) Python, where annotations are effectively functions wrapping the function they annotate, in java they're more akin to a customisable preprocessor. Obviously I do use them, liberally, because that's the way things are done, but I'm not a big fan. And using any modern framework relies on these a lot.

Micronaut gripes -

1. It works great until it doesn't, and you have a special case, and then you have to dig into source to figure out what on earth is going on.

2. Keeping up with latest isn't always easy, micronaut 3->4 was a huge effort.

3. For all it's called micronaut, the produced packages are pretty huge.

Serverless-specific gripes -

1. What I'm receiving isn't really an http message over a socket. It's an AWS gateway event with everything already read and packaged up. So there's no reason that (for instance) I shouldn't access the message body in a request filter, because I don't give a crap about the jetty server-loop being non-blocking.

2. Startup time is terrible. And when I managed to get a native compiled version to actually run, it got worse. A lot of this seems to be down to hibernate, but there's a big gap between startup and any logging from the framework at all. We've tried a bunch of stuff to remediate, so far with little success.

In general I think that serverless is such a different paradigm from a long-running server that approaching it from the point of view of "how can we make this the same so developers who've never thought outside of the spring-like box can still be productive?" was wrong from the outset.

Re: Java 26 is here

#236
post #58
post #37

the people that work on Java & the JVM are very smart. it has become a best of breed language - hell its better than Go for industry purposes. the drawback with Java will always be the CULTURE - (maybe someone can insert a quote of how in physics progress is only made, when old physicist die - I don't wanna be morbid ) but with Java same that's when the culture will change. All those people using typescript (could be…

It's getting better, it doesn't all have to be Spring Boot and JBoss. There is quarkus, helidon and micronaut for slimmer more modern backend frameworks. jbang for scripting (think uvx, bunx), Tambo UI ( https://tamboui.dev/ ) for terminal UIs, and more. Along with all the new Java features that help you write much simpler code - eg. virtual threads, structured concurrency, stream gatherers, and performance / resourc…

I'd like to mention the web framework I'm using these days, Jooby:

https://jooby.io/

I've found it quite satisfying compared to the other "new" ones.

As for the original topic, I just want to echo what others have said, and say that I am happiest in Java when writing it as if it were Golang code. That an the first-class runtime and performance and deep ecosystem make it a great choice in 2026.

Re: Java 26 is here

#237
post #150

Earlier quoted context omitted.

Use javac directly, in a recent JDK, to compile lots of files at once (i.e. one invocation of javac to compile multiple files) and you'll see. The speed is over 100,000 lines/sec: https://mill-build.org/blog/1-java-compile.html

Seriously a need for a new build tool in Java that doesn't fuck around too much.

100% this. Ant was bad in many ways, but at least it was lightning fast. Gradle is just tragic.

Re: Java 26 is here

#238

I program in Java for more than 15 years now. I can resonate with people hating the language from it's early days due to the experience with all the enterprisy features and over abstractions. Or confunding Java with the Spring ecosystem. But Java came a long way over the years. It's now what many would call a "modern" language. It's less verbose, has many of the features people find appealing in Scala and Kotlin and…

I recently worked on a Go project and my task was to make it more configurable at build time and start time (add plugins / addons, make it possible to reuse from other libraries and tools). Turned I had to create *Factory and *Providers, even though I did not want to. It's easy to avoid "AbstractFactoryProviderBuilder" if everything is hardcoded. Try to make it reusable and extensible, and I bet you write one yoursel…

> It's easy to avoid "AbstractFactoryProviderBuilder" if everything is hardcoded. Try to make it reusable and extensible, and I bet you write one yourself.

The first domino is opting for OOP. AbstractFactoryProviderBuilders are just the inevitable downstream consequence of that initial choice. No need for factories if you don't traffic in objects in the first place.

Objects. Just say no.

Re: Java 26 is here

#239
post #37

the people that work on Java & the JVM are very smart. it has become a best of breed language - hell its better than Go for industry purposes. the drawback with Java will always be the CULTURE - (maybe someone can insert a quote of how in physics progress is only made, when old physicist die - I don't wanna be morbid ) but with Java same that's when the culture will change. All those people using typescript (could be…

Hey even Go has got effective `FactoryFactory` stuff in a lot of open source projects. They just name it differently.

Re: Java 26 is here

#240
post #199

Earlier quoted context omitted.

Well, what mainstream language has better tools for composition?

Rust with traits and Swift with protocols

So just type classes?

How does a type class help with composition? They do help with the expression problem (adding support for an "interface" after definition), and via parametric polymorphism they might give you a bit with regards to composing two traits.. but you do also have generics in Java, even if not as good as type classes.

So anyways, I don't see as big of a change here. But there was a Brian Goetz mail/presentation somewhere where he talked about adding "basically type classes" to Java? But unfortunately I couldn't find it for you now.

Post reply on HN