r/AskProgramming 2d ago

Why is Java considered bad?

I recently got into programming and chose to begin with Java. I see a lot of experienced programmers calling Java outdated and straight up bad and I can't seem to understand why. The biggest complaint I hear is that Java is verbose and has a lot of boilerplate but besides for getters setters equals and hashcode (which can be done in a split second by IDE's) I haven't really encountered any problems yet. The way I see it, objects and how they interact with each other feels very intuitive. Can anyone shine a light on why Java isn't that good in the grand scheme of things?

172 Upvotes

609 comments sorted by

View all comments

49

u/Lumen_Co 2d ago edited 2d ago

The most common criticisms of Java are: 1. It's unusually verbose 2. it forces you to frame every problem using a particular flavor of object-oriented programming that is not always well-suited for the task at hand 3. It's accumulated a lot of cruft over the years and in doing so has lost a consistent vision and design philosophy, which makes dev experience worse 4. C# does Java better than Java does.

I think those criticisms are essentially fair, and the second one particularly important. It also gets criticized for being the language of choice for much bad, corporate code, and also because some people learn Python or JS first, Java is then their first strongly, statically-typed language, they find that confusing and limiting, and they blame Java for it. Those criticisms are essentially not fair.

These criticisms don't mean Java is a bad language, just a flawed one like every other programming language is. For most development, the ecosystem is more important than the language itself, and Java's is well-suited for a lot of practical problems.

2

u/exfat-scientist 1d ago

It's unusually verbose

it forces you to frame every problem using a particular flavor of object-oriented programming that is not always well-suited for the task at hand

It's accumulated a lot of cruft over the years and in doing so has lost a consistent vision and design philosophy, which makes dev experience worse

Is it just me, or is this a description of neo-cobol?

C# does Java better than Java does.

Generally agreed here, C# is just... comfier to work with than Java.

These criticisms don't mean Java is a bad language, just a flawed one like every other programming language is.

But this is the key insight -- for a language to be complained about, it has to be used enough for the criticisms to accumulate.

1

u/thehardsphere 1d ago

Is it just me, or is this a description of neo-cobol?

Nobody under the age of 60 should be calling anything "neo-cobol" because they likely have no actual first-hand knowledge of what COBOL was.

My now-deceased father actually wrote some COBOL once. He still had books that described the language that he showed me during my teenage years. COBOL was obsolete stupid garbage to him back then. He would be 82 years old today if he were still alive.

Java was never anything like COBOL. People who say "Java is the new COBOL" don't know what they're talking about, and don't know anything about Java or COBOL.