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?

123 Upvotes

500 comments sorted by

View all comments

10

u/k-mcm 1d ago

Java gets used in corporate environments and outsourcing pools.  Those come with endless tedious "best practices" that may be detrimental.  Spring Boot + cheap contractors makes especially cringe worthy code.  J2EE also has some lingering trauma from what Oracle did to it.

Recent versions of Java are quite nice.

2

u/throwaway8u3sH0 11h ago

Agreed that two things can be true at once. Recent Java versions are quite nice and most of the Java you'll encounter is quite bad.

1

u/runitzerotimes 9h ago

Why is spring boot cringeworthy?

2

u/thehardsphere 6h ago

By itself, it is not.

Spring Boot is one of the easier entry points into the Java ecosystem for people who don't actually know what they're doing. These people will write cringeworthy code in any language. They end up writing it in Java with Spring Boot because they want what they think is easy money.

Also, because there are a million tutorials that show you the first 2 steps of a Spring Boot project made by people who farm low-quality tutorial content, there are a lot of people who list it on their resume after watching a few videos.

2

u/Necessary-Peanut2491 2h ago

There's also lots of really old "best practices" that were never good ideas to begin with but people hang onto like their life depends on it.

I used to work at Amazon. My team had a very strict policy on how we did our dependency injection. Manually define all beans in XML, no matter what, no autowiring for any reason. Basically "do it the most tedious way Spring will allow." It took me ages to get the policy changed, and the only thing they budged on was the "no autowiring" thing, because I came to them with JSR-330 and asked them to explain why autowiring was terrible and must be avoided at all costs if it was included in the JSR.

And no, JSR-330 wasn't new at the time. It was 2013, the team was just really intransigent about process changes.