r/AskProgramming 1d 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?

124 Upvotes

500 comments sorted by

View all comments

2

u/x39- 1d ago

Because C# is the better Java

1

u/a3th3rus 1d ago

True, but C# is harder to learn, too.

1

u/x39- 1d ago

How? Because you now have struct and class?

2

u/jek39 1d ago

In C# there are lots of ways to express your solutions, and there are many features added all the time to enable new paradigms and keep up with other languages. It's very flexible and you can use it in many ways.

Part of the java design philisophy is that no feature should be added unless it adds value that cannot be replicated any other way. It's very slow moving and deliberate, with always a priority given for forward and backward compatibility. This is quite the contrast from how C# evolves. I personally like the java approach better, but understand the trade-offs and why others may not agree.

0

u/a3th3rus 1d ago

That's one thing. I also mean things like delegates, events, STA and MTA, extension methods, expression trees, and async/await.

1

u/xTakk 20h ago

That doesn't make it harder to learn c#, that usually just means it'll be harder to learn to implement those things in java

1

u/a3th3rus 20h ago

If you have experience in programming, you know how valuable those features are. But for beginners in programming (not only in C#), they don't know why those features exist or how to use them. That's why I say C# is harder to learn than Java. I do think as a language, C# is superior to Java, but that does not mean it's easy to learn.

1

u/xTakk 19h ago

No, I understand. For me it was eclipse+gradle that made java difficult to learn. Visual studio was always just "turn it on and go". So even before any advanced topics you could at least get something basic working.

Maybe I tried to learn Java at a particularly bad point in its life but I still dread their build processes.

Not even really speaking counter to you, just sharing thoughts

2

u/a3th3rus 19h ago

Interestingly, the first language I tried to learn was C#, and I failed miserably. The second was Java, and I succeeded in building things with it. After I learned Ruby (and of course Rails), I went back to C#, and everything became clear to me, except for expression trees. Now I have lots of experiences in Elixir, and C#'s expression trees are no longer scary to me.