9 comments

[ 3.7 ms ] story [ 27.3 ms ] thread
Java is a great language with a terrible ecosystem. Why is it so awful, and what can be done about it?
If anything it is the other way around. C# is a better language than Java but has a much worse ecosystem.

People complain that they can’t do what they want in a maven POM file but that is because you aren’t supposed to be able do very much with XML. POM is based on a system that materializes Java objects that do the work. When you find “you can’t get there from here” in a POM that is the time to write a Java class that does what you want and load it into your POM.

If you try Python you might find yourself pining away for maven’s correct dependency resolution algorithm.

Most people think annotations in Spring are a way to avoid the annoyance of XML but you disagree. I will tell you what’s not in the manual though. The Spring core framework, like the maven POM system is all about instantiating ordinary Java objects. Some people though seem to think life isn’t meaningful without ‘plugins’ and ‘integrations’ but unfortunately they pay a heavy price for this. You don’t need “Spring X” to do “X” in fact you are very fortunate if incorporating “Spring X” doesn’t fail your project right there. “Spring X” projects are run by whatever rando got the idea to make it first and there is no quality control or no effort to maintain the Spring brand image. (Though Spring Batch does have some great ideas, unironically, that have been passed down by the macro assembler masters of the mainframe era.)

I still like Spring but a lot of people have moved on to Guice.

How does someone move from sprint to Guava? From what I understand Guava provides nicer collections and utility methods which is not nearly the same thing the Spring ecosystem provides.
... oh crap I meant Guice! Sorry about that, I edited it above.

Guava is it's own thing with its own problems. In particular I think Guava has proven itself to be very dangerous as a "superdependency" that does too much. Somewhere around Guava 13 they introduced a change that broke HDFS and I was coding for Hadoop at that time and ran into problems w/ diamond dependencies I couldn't bring into my project because they required a Guava that broke my runtime.

I'm a big fan of Micronaut's compile time DI, especially as it can be used standalone.

I hated DI from my experiences with Spring, but compile time DI and a deliberately less complicated approach helped me enjoy it again. No more waiting a minute for the giant Spring app to eventually throw a bean not found exception.

Quarkus also has compile time DI, but currently it's rather coupled to Quarkus' build steps.

Oh, and yes, moving to a Python codebase makes me miss JVM dev so. Much.

I disagree. I’m not saying Maven is perfect but I find the way it does builds and dependencies FAR preferable to what C++ or JS have.
Obviously we disagree on this and JavaScript (as I mentioned in the post), but wholeheartedly agree about c/c++. Trying to figure out how to share a C library, for example, is a huge mess.
So I will note I’ve never done a JavaScript server project. My experience is entirely related to building for the web.

However even if we exclude that I don’t like the way dependencies are handled. I much prefer Maven’s single repository instead of having a node_modules folder in every project.

I know a lot of people hate XML but it’s not that bad. And it was the popular thing in 2004, JSON and YAML were extremely new on didn’t have mindshare yet.

When you lead with "XML is bad", I feel you're missing the wood for the trees.

What I really like about Maven is that the build file is declarative.

Now, would it be better in JSON or YAML? That's really a matter of taste.

Also, Maven artifact repositories have one massive feature that everyone else omits for reasons I can't fathom - verified package namespaces, so no typosquatting here.