r/AskProgramming • • Mar 20 '25

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?

226 Upvotes

695 comments sorted by

View all comments

53

u/Lumen_Co Mar 20 '25 edited Mar 20 '25

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.

6

u/lordheart Mar 20 '25

If they think Java is verbose, they haven’t met Abap yet. Saps homegrown language modeled after COBOL back when it was new.

3

u/oloryn Mar 21 '25

COBOL itself is quite verbose. And some aspects of it can vary by vendor (back when I was hacking on Burroughs Medium Systems, I discovered that Medium Systems COBOL could handle recursive PERFORMS (essentially a subroutine call), which most other COBOLs at the time couldn't).

→ More replies (3)

4

u/oriolid Mar 20 '25

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

Some people also learn ML-style languages, C# or even C++ first and find the Java type system really limiting compared to almost any other static typing system.

→ More replies (3)

5

u/senfiaj Mar 20 '25

Also Java has null safety issue. It's one of the major arguments, and one of the reasons of the rise of Kotlin's popularity.

4

u/okay_throwaway_today Mar 20 '25

I feel like Optionals and some other QoL things in Java 8+ have addressed this and, continuing in later releases, a lot of the other more famous criticisms. But of course the benefit of those depends on what version or style the codebase at hand uses, and Java is prominent in a lot of legacy stuff

4

u/Reggienator3 Mar 21 '25 edited Jun 21 '26

Overwritten for privacy

→ More replies (1)

2

u/Wonderful-Habit-139 Mar 21 '25

They haven't addressed it because they can still be null, sadly. But they're nicer to use in newer codebases for sure.

2

u/[deleted] Mar 21 '25 edited Mar 23 '25

[removed] — view removed comment

→ More replies (5)
→ More replies (2)

8

u/DeadlyVapour Mar 20 '25

Let me also add that Kotlin does Java better than Java...

Given both target the JVM, and both can output the same JBC, I know what I prefer to use....

11

u/__SlimeQ__ Mar 20 '25

while i recognize that kotlin does a lot of things better than java, i still find myself preferring java for jvm work. it can be really annoyingly difficult to find documentation for kotlin stuff still and splitting the codebase between two languages is, imo, kind of bad. and in general i don't agree with the pythonization of the whole thing, I prefer C# over any pythonish lang.

i really just wish C# maui worked better so i wouldn't have to touch any jvm lang ever again. feels strange to me that Unity has figured out how to do native android C# and microsoft has not

2

u/runitzerotimes Mar 21 '25

Kotlin is downright dumb imo

I just constantly find myself thinking “WHY DID THEY THINK PEOPLE WOULD LIKE THIS” to all the syntactic sugar they have

→ More replies (3)

2

u/laffer1 Mar 22 '25

Kotlin also has a lot higher memory requirements for the compiler stage. It can be a problem on large projects with limited build nodes for ci

→ More replies (1)

2

u/taikuukaits Mar 23 '25

I use C# 10 and Kotlin and I still strongly prefer Kotlin. C# is getting a lot closer but still missing QOL I like in Kotlin like elvis operator seem more exhaustive, lambdas as last arguments, sealed types, DSLs, smartcasts seem slightly better though c sharps version is pretty good, being able to copy data classes easy in Kotlin, not sure if there’s a way for records, Kotlin compile time serialization. Though C# version of smart cast is pretty nice - or their null cast? W/e it’s called. I can’t really think of any other C# features I prefer except static instead of companion objects just being simpler and I do actually like the new keyword.

→ More replies (2)

5

u/Lumen_Co Mar 20 '25

True. If you want a Java-style language, C# does it better. If you want the Java VM, Kotlin does it better and is similar enough to pick up quickly. If you're open to something funkier, Scala and Clojure are cool.

2

u/exfat-scientist Mar 21 '25

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.

→ More replies (1)

2

u/MishkaZ Mar 21 '25 edited Mar 21 '25

Number 2 is what I hate about working with jvm languages. Like you'll think of the sickest abstractions or inheritance trees, then a new requirement comes in and you have to spend hours refactoring.

Also another thing I don't like about jvm languages is just how much ivory towerness I encounter. Like you either know the in-speak/in-lingo or you don't.

I will always work in where the paycheck is, and it is definitely better than working in python/typescript for me, but it's my least favorite strictly typed language.

→ More replies (13)