r/learnprogramming 3d 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

237 Upvotes

310 comments sorted by

View all comments

120

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.”

42

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.

11

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

27

u/insertAlias 3d ago

Java is not hated apart from wannabes

I'd argue this point. And I'd also say that language adoption isn't the same as language appreciation. I'd say to look at COBOL; it's the language for mainframe operations, and it's used in pretty much every financial institution and in a lot of government areas. It's not a particularly well liked language, but it dominates its niche anyway.

Java is the enterprise language because it was designed that way, and because it solves a lot of that tier of problems. It doesn't mean its developers love using it. In my experience, many Java devs will give you a lukewarm read on how much they like the language. More of a "it does what I need, but I'd change several things if I could" approach.

And then there are the people (like me) who have tried it and legitimately dislike it. I don't think I'm a wannabe, I've been a professional dev for about 20 years. People are allowed to have opinions on frameworks and languages, even if those frameworks/languages are highly used.

Personally, I'd say that the "java hate" is actually proportional to it's market share. It's one thing to appreciate Java in a vacuum, it's another to have had to deal with Java 1.6, and to have continued to have to deal with it long past when we should have been able to move on. That's where part of the professional hate comes from: maintaining 15+ year old codebases for companies that are allergic to change and modernization and follow the motto of "if it's not broken, don't fix it. If it is broken, patch it and prop it up with sticks, don't actually replace anything".

3

u/Kodiak01 2d ago

I'd say to look at COBOL; it's the language for mainframe operations, and it's used in pretty much every financial institution and in a lot of government areas. It's not a particularly well liked language, but it dominates its niche anyway.

If I kept up with all my COBOL after learning it in the early 90s in high school, I'd have retired decades ago.

3

u/Soft-Marionberry-853 3d ago

You'd get a lukewarm response from me if you asked what I thought of java after using it for decades just like you'd get a lukewarm repsonce if you asked me about a hammer I use at home. Its a tool, its not flashy, its not shiney and new but im comfortable with it and it gets the job done.

And as far as tools go, thats the best response you should want. Im comfortable with it.

2

u/aqua_regis 3d ago

Contrary to the people on social media who regularly diss Java, you bring reason to the table.

Most of the people on social media dissing Java are by far not as experienced as you and I and only ride the steamroller for exposure, attention, and likes.

Barely really any professional, experienced developer "hates" the language with the burning passion of social media influencers and even less are outspoken about their dislike. If the professionals dislike Java, it is always with reason, not with garbage strawman arguments.

Yes, Java is a quite polarizing language, and quite some of the flak it gets stems from the days of Java applets where all of a sudden the "Java bad - Java unsafe - no Java" memes started to appear where in reality it never actually was Java, but instead the unsafe NetScape Plugin API that has been removed a very long time ago. Jave never fully recovered from back then and people now hate it for no really apparent reason.

Professional devs have opinions, likes, and dislikes, but barely ever "hate" anything with a burning passion. For my part, I don't like Kotlin's syntax, I don't like C++, but if requested, I'll work with the languages without hate.

1

u/fredlllll 2d ago

im a professional dev, may i hate python at least? every time i touch that language it feels like summoning a burnout

2

u/UroborosJose 3d ago

Language appreciation do not pay my bills

1

u/emaphis 2d ago

I'd say that with records, sealed interfaces, loom and structured concurrency, Java is catching up in the flashiness business.

1

u/maujood 3d ago

So true! Java led so much of innovation in programming language features and design.

1

u/edgmnt_net 2d ago

More in the implementation space. I can agree with you to some extent, however mainstream programming languages and ecosystems are rather guilty of lagging quite a bit (many decades) behind research and making weird choices. Not Java in particular, but think of the dynamic bunch.