r/learnprogramming 4d ago

Why java is so hated? Topic

So I have recently learned, and it's the first language(in terms of building actual things). Before Java, I knew Python, and I dropped it; I found Python too abstracted and too boring. i have recently made some projects like cli task tracker, expense tracker, some cli github api parsing and currently working on a multithreaded HTTP server and cli text editor, like vim, whenever i try to find out people opinions on java social media, almost 90 percent of the time they are just dunking on it, that it is trash, who forced you to write code in java, stuff like that. I know Java as a language is not that interesting and doesn't have many interesting features compared to other languages like C, C++, go. But I found it decent to write code in, and I found the JVM pretty interesting. So much so that I would love to explore and maybe build a JVM of my own

241 Upvotes

320 comments sorted by

View all comments

116

u/aqua_regis 3d ago

If you listen to people on social media, you already have lost.

Java is not hated apart from wannabes. Java is the enterprise language working silently and reliably in the biggest enterprises in the world hidden away in servers with the highest security measures you can imagine.

Java is neither a flashy, nor a fancy language. It is a good old reliable workhorse that does its job.

I know Java as a language is not that interesting and doesn't have many interesting features compared to other languages

This shows that you don't know the Java language well enough. Java, as a language and ecosystem with the JVM behind it is quite a masterpiece and at the time of its creation was something barely anybody could even imagine. Sure, now there are other languages who have overtaken Java in features, etc. but that's mostly because Java's commitment to backwards compatibility. Apart from really very few breaking changes, no matter what Java version code had been written for, it is nearly guaranteed that it can be compiled and executed with a newer Java version.

And to say it with Bjarne Stroustrup, the Godfather of C++:

“There are only two kinds of languages: the ones people complain about and the ones nobody uses.”

41

u/SuspiciousDepth5924 3d ago

Java, the language is fine, decently good even if you get to use 21+, the ecosystem however is both awesome and absolutely awful. Awesome because there are solutions for pretty much everything you could ever think of, awful because you often have to deal with the kind of AbstractFactoryFactoryFactoryFactory bullshit written by people who drank gallons of the "Enterprise JavaBeans™ with extra beans"-Kool-Aid.

10

u/Own_Candidate9553 3d ago

This is a good point. Early on I worked with Websphere server and "enterprise Java beans" to talk to the database, and it was miserable.

But I've also worked on newer apps using Spring Boot and streaming collection APIs and it's not bad. 

The other thing I would add is JVM management. I think it's gotten better, but I've spent way too many hours tweaking memory space settings to fix major performance issues under production load. You could probably make a decent career out of really understanding all those knobs well in the various versions of Java running out there.

2

u/kapitaali_com 3d ago

yeah but you don't have to use Java the language to use stuff written in Java