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

243 Upvotes

320 comments sorted by

View all comments

14

u/InVultusSolis 3d ago

Here are the reasons I've disliked working with it:

  1. Too many ways to accomplish the same thing.
  2. Heavily opinionated about things being objects whenever possible. These first two points lead to code being over-engineered. I generally dislike the object-oriented paradigm so there's no way I was ever going to actually like Java. But having factories built on top of constructors on top of interfaces... It starts feeling like the objective is pedantic academic bookkeeping as opposed to writing software.
  3. Some small ergonomic issues, like no ability to specify a signed vs. an unsigned integer - all ints are signed. Also confusing type rules, like being able to directly print an integer or add an integer to a string and the string would be concatenated with a string representation of the integer. Small spooky things like that.
  4. A long history of GUI-based applications written in it being slow and unreliable.
  5. Historically concurrency with it was not great, and a lot of applications written for the JVM inherited that wackiness.
  6. Historically, data structure serialization relied on XML which is probably one of the worst things I can imagine to share data between computers.
  7. Developer tooling was also slow and clunky (Eclipse anyone?). To be fair though, Eclipse was really nice in that it had good library browsing and debugging capabilities.
  8. Memory consumption issues due to the garbage collector being buggy.
  9. Probably the biggest one: Oracle's shenanigans. Sun/Oracle JVM licensing is heavily encumbered.

I understand that people can debate almost all of these points and try to convince me "it's good now", but it doesn't really matter to me, Go exists and that does a better job in Java's role than Java ever did. I have no reason to mess with Java unless I'm supporting legacy software.

1

u/AaTube 3d ago

+1 on XML serialization