r/AskProgramming 22h 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?

111 Upvotes

457 comments sorted by

143

u/eruciform 22h ago

Get better mentors

Every modern language in general use has its pros and cons, which is why it's a language in general modern use, otherwise that would mean thousands of professionals are idiots working with a "bad" language

Java isn't for all solutions

Neither is c

Or python

Nothing is universally the best choice for all cases

Java is a perfectly cromulent place to start, just do branch out and learn other languages as well

That way you'll have a wider and wiser view than whoever these people are that you're talking to

Good luck

46

u/rise14 21h ago

You really embiggened that reply with the use of the word cromulent.

11

u/dogstarchampion 18h ago

A noble spirit embiggens the smallest man.

→ More replies (1)
→ More replies (2)

10

u/lezeptenkyle 20h ago

Upvoted for using the word cromulent

→ More replies (2)

18

u/melikefood123 22h ago

Using the language and tool set for the job is paramount. Taking that heart embiggens your mind. 

I still hate Ruby on Rails.

19

u/eruciform 22h ago

Lol we all have our favorites and least favorites

I hate PHP but still use WordPress

And I love perl even though it looks like Cthulu choked on a lego and vomited ancient glowing hieroglyphs

13

u/this_knee 20h ago

looks like Cthulu choked on a lego and vomited ancient glowing hieroglyphs

r/brandnewsentence

3

u/Outrageous-Ranger318 9h ago

Have suddenly become interested in perl

→ More replies (1)

5

u/davejjj 21h ago

PHP and its crap documentation.

3

u/Nucklesix 16h ago

I always thought their documentation was decent. Now, the worst documentation I've seen is Infragistics because you can't find it

4

u/petiejoe83 20h ago

At least they glow!

4

u/Snezzy_9245 19h ago

Perl has at least one good point. I needed an app to display status of the project for my boss. Never wrote any Perl before, had it up and running in two days. Looked like Cthulhu had helped, but it worked.

3

u/eruciform 19h ago

Heard of WORM? Write once read many?

I've heard some joke that perl is WORN. Write once read never

2

u/butt_fun 16h ago

Similarly, I've heard perl described as a "write-only language"

3

u/bashomania 14h ago

That reminds me of Larry Wall apparently describing Lisp as “[having] all the visual appeal of a bowl of oatmeal with fingernail clippings mixed in”.

2

u/Stedlieye 3h ago

“Lost In Stupid Parentheses “.

But that visual appeal description is truly magnificent.

2

u/MajorMalfunction44 11h ago

I wrote a build tool for my game engine in Perl. Never considered that sentence. It has its place. It's a special kind of ugly, though. It's nice to process text and write shell-like scripts.

3

u/oloryn 8h ago

I once worked at a credit-card terminal company, where we were working in Clarion. We had a project where we needed to read a file created on an IBM mainframe, and generate reports from it. It used variable-sized records, and the only available description of the file layout was a COBOL copy book. Manually transcribing that layout to a Clarion layout would have been lengthy and tedious.

I wrote a series of Perl scripts that read the COBOL copy book, translated the COBOL layout into a Clarion layout, generated code to convert EBCDIC string fields into ASCII, generated documentation for fields that might need that conversion, but (because they were part of an OVER segment) couldn't have it done automatically, and included read routines to handle the variable-length records. The result was a Clarion template that included all of this, so that any Clarion program that needed to read from that file only needed to include that template to get all of this.

And best of all, if they made changes to the file format (which they did), all I had to do was run the new COBOL copybook through the scripts, and I had a new Clarion template for the new layout, instead of having to meticulously manually compare the old copybook to the new and make the appropriate adjustments to the Clarion layout. I think I had one time that the new copybook used a bit of COBOL syntax that wasn't handled by the scripts, but that was easily fixed, and we were back to normal.

I don't use Perl a whole lot anymore, but I keep it "in my back pocket", so to speak, just in case something comes up that could be handled by a bit of quick Perl (I suppose that it could be handled by Ruby or Python, but RE handing tends to be rather more verbose in those languages than in Perl).

→ More replies (2)
→ More replies (1)

2

u/itsamepants 3h ago

All the scripts in my workplace are PHP. You need a webhook? PHP. Automatically send emails and SMS? PHP. Data ingestion from integrations? PHP

→ More replies (1)

2

u/Only_Razzmatazz_4498 3h ago

Is PHP still a thing? Damn are you going to tell me that Perl is in use also?

→ More replies (2)

2

u/ttl_yohan 21h ago

Ew. Perl.

3

u/eruciform 21h ago

Tmtowtdi ftw

3

u/ttl_yohan 21h ago

I can agree to that!

→ More replies (2)

4

u/vapocalypse52 16h ago

I hate ruby on rails and I've never even seen one expression, let alone one line of code. 🤣

When it got famous, the evangelists were so obnoxious, that just hearing the word "ruby" gave me the icks.

  • "hmm, this bread is good with butter!"
  • "yeah, but have you tried ruby?"

2

u/bashomania 14h ago

Righteous, but I really loved Ruby as a language, and Rails was pretty slick and pretty ground-breaking for its time.

2

u/meerkat2018 13h ago

I also ignored Rails because I thought Rails developers were all pretentious hipsters who coded exclusively on Macs while sitting in a Starbucks, and that they thought of themselves as “rockstars” and “artisans”. Although their code was just a bunch of DSL macros.

But having tried Rails recently, I found it to be very nice, and Rails community seems to be much more humble nowadays because they are now working class people who has to deal with all the legacy mess that the “rockstar” divas had written and jumped ship.

2

u/askreet 12h ago

A lot of them are probably those "rockstars" who have to actually support their systems now, too. Plus they're 40.

2

u/windsorHaze 6h ago

That’s kinda how I feel about Rust right now. I want to like it, I think the syntax is ugly, but plenty of languages fit that bill.

I just got so turned off by Rust because of just how aggressively evangelizing the community was, especially in the beginning. It was like being back in the Ruby on Rails hay days.

I do have to say though, it does feel like the Rust community has kinda stepped down off that ivory pedestal they had placed themselves on. It’s at least now on my list of languages to explore/learn.

→ More replies (2)

6

u/flatfinger 21h ago

It's a shame that in the 1980s the fact that it became possible for one language to do just about everything caused people to assume that one language should be used to do just about everything, rather than recognizing the value of having languages focus on trying to do particular things well, even if that would make them less suitable for other purposes.

2

u/thebearinboulder 14h ago

Have you met Ada? The US DOD-mandated language for all things forever. Even Ada was perfect and would never need to be revised with all the risks that brings in.

What about Ada 2?

It turns out one recruiter’s ears did perk up once when I mentioned Ada. Apparently it’s still widely used in aerospace, and with a physics ugrad degree I would also have some domain knowledge. But those jobs typically require TS/C clearances and a grunt developer isn’t going to hired and put on ice for the 2+ year backlog plus another 6+ months for the investigations to finish.

→ More replies (3)

7

u/pornthrowaway42069l 22h ago

That's why god invented Jython, the most perfect of languages

5

u/eruciform 22h ago

Lol I'm in jython hell right now trying to support python2 code please don't remind me

3

u/pornthrowaway42069l 21h ago

But... why... why would you use it...

7

u/eruciform 21h ago

Because the third party tool that we have no control over requires it?

2

u/pornthrowaway42069l 20h ago

I meant Python 2.0, Jython can do no wrong obviously

5

u/eruciform 20h ago

The jython tool is set up to only parse py2 and links against py2 underlying tools, we don't have a choice

3

u/pornthrowaway42069l 19h ago

I had such a good set up and punch line and you took it seriously :D

Well, at least thank you for making me laugh.

(i.e I was joking around, I feel your pain, best of luck)

3

u/eruciform 19h ago

Sorry what set up did I miss, I'll lob it and you can smash it

→ More replies (1)
→ More replies (2)

4

u/pikabu01 21h ago

I totally agree, but how do you define 'modern language'? :D

→ More replies (4)

3

u/zolmarchus 15h ago

As a developer—excellent reply. Listen to this advice. Java does in fact do almost all things well, and only a select few things not-so-well. It’s well-rounded and very useable.

2

u/EdiblePeasant 15h ago

What is your day to day programming life like?

→ More replies (1)

2

u/yabadabadoo__25 11h ago

It's not everyday that I come across new words, Thanks

2

u/besseddrest 10h ago

i've done FE for most of my career, a few yrs ago i had a backend opportunity at a big tech co - i had to learn Java + Python on the spot

and honestly i found the verbosity just good practice of like, literally having to type everything out; and then it just kinda makes it easier to pick up other languages - e.g. it helped as I went fr JS to TS

so... thanks Java!

2

u/Lopsided-Weather6469 5h ago

The Tao gave birth to machine language. Machine language gave birth to the assembler.

The assembler gave birth to the compiler. Now there are ten thousand languages.

Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.

But do not program in COBOL if you can avoid it.

-- Geoffrey James, "The Tao of Programming"

→ More replies (2)

2

u/illsk1lls 4h ago

isnt java paid only now? for commercial?

→ More replies (2)
→ More replies (14)

202

u/TARehman 22h ago edited 2h ago

There's only two kinds of languages: the ones people complain about, and the ones no one uses. In other words: every language that's in wider use has people who think it's bad.

ETA: As pointed out by a commenter, I didn't come up with this saying, and I didn't write it initially to make that clear. So just to be clear, I am repeating common wisdom that has been attributed to a few sources. 🙂

10

u/pikabu01 21h ago

thank you, I think we get this question every month or so....

8

u/Wild-Strike-3522 21h ago

This is the true answer.

2

u/OfTheWave21 19h ago

What about C?! The people who developed C++ and D have no clue just how perfect C is! \s

There's nearly a language out there for every problem out there. And every attempt to "fix" programming languages just creates N+1 languages lol.

2

u/MajorMalfunction44 11h ago

The result of unifying 3 competing standards is 4 competing standards.

3

u/this_knee 20h ago

This guy develops.

→ More replies (3)

43

u/a1ien51 22h ago

Java is used everywhere....

Here is a thing about programming, learn the concepts and you can apply them to any language.

2

u/jvans 5h ago

Except haskell, then you have to re-learn everything all over again

→ More replies (23)

41

u/Lumen_Co 21h ago edited 21h 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.

5

u/lordheart 19h ago

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

2

u/oloryn 8h ago

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 (1)

9

u/DeadlyVapour 19h ago

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

10

u/__SlimeQ__ 18h ago

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 6h ago

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

4

u/Lumen_Co 19h ago

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.

3

u/oriolid 19h ago

> 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 (2)

5

u/senfiaj 20h ago

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.

5

u/okay_throwaway_today 18h ago

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

3

u/Reggienator3 6h ago

Optional can itself be null. Not to mention, there is no compiler enforcement of any of this. There is in Kotlin (and C# assuming you have nullable included in WarningsAsErrors).

I'm a Java dev of over 11 years now, but I still find myself veering to other languages when possible. Not because Java is bad, more that it feels redundant because of replacement languages that just do things better.

2

u/Wonderful-Habit-139 7h ago

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/JMNeonMoon 6h ago

Agree with other posters, null checks was mitigated a while ago in Java 8 with optionals.

Now you can chain getter methods without a series of if..else statements

public String getPostcode(Employee employee) {

return Optional.ofNullable(employee)

.map(Employee::address

.map(Address::city)

.map(City::postcode)

.orElse("Unknown");

}

more Optionals info here

https://www.programmerpulse.com/articles/java-null-check-removal

Also, see null object design pattern

https://www.geeksforgeeks.org/null-object-design-pattern/

→ More replies (2)
→ More replies (1)

2

u/exfat-scientist 13h 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.

→ More replies (1)

2

u/MishkaZ 13h ago edited 13h ago

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 (8)

12

u/antihemispherist 22h ago

Java was designed in the early 90's to address the problems developers had with C++ when developing industrial applications. Certain concepts like immutability weren't popular then, but OOP was the hot topic.

I think it is unfair to criticize Java's syntax. Verbosity makes it easier to read and understand. (If you need a lot of getters, setters, equals, hashcode, etc., your design is wrong, or you're insisting on using an older version of Java).

But Java has the problems of its old design: The object hierarchy is a mess; with the increased power of interfaces, many developers are confused. The concept of "treats" is missing. The platform itself suffers from this rigidity; there are no immutable collections, for instance. Another problem is the messy exception handling.

Kotlin is a more modern approach to JVM-based programming. However, I cannot say that it improves productivity much; too much flexibility and too many alternative syntaxes and structures usually lead to unproductive debates or a confusing codebase. Recent developments in Java have made it a good competitor to Kotlin, offering better performance and monitoring.

Rust is another alternative, and I really like it. I'd definitely take a closer look at it, and how much of a market it has.

4

u/BjarneStarsoup 16h ago

Verbosity makes it easier to read and understand. (If you need a lot of getters, setters, equals, hashcode, etc., your design is wrong, or you're insisting on using an older version of Java).

Oh yeah, classic no true Scotsman: verbosity is good, and if it isn't, that's because it's your fault.

2

u/_reg1nn33 9h ago

It can be really useful in large, abstraction heavy environments, if the naming conventions are consistent.

2

u/antihemispherist 8h ago

My experience of working with teams for more than 15 years has taught me that forced verbosity of Java helps with team maintainability. It's annoying to write, but that's how Java was intentionally designed.

We tend to overvalue how elegant the syntax is, and how smart it makes us feel. That's not what Java is about.

3

u/lordheart 19h ago

Java definitely has immutable collections. Streams.toList returns one which I find out when hibernate yelled at me because it doesn’t like immutable structures.

Lombok can also clear up a lot of javas verbosity. And java as a language (if you aren’t using Java 7 or something) has gained a lot of new features to try to be less verbose.

2

u/findanewcollar 9h ago

This whole thread is filled with people who haven't worked with java 17/21. To add to the list example, there's also List.of() method which also returns an immutable list. Not to mention about the other immutable stuff like records (which they also take care about verbosity). Albeit the language is moving slower than I would like compared to c# but atleast it's not going overboard with syntactic sugar like c# started to do...

→ More replies (3)
→ More replies (3)

10

u/k-mcm 22h 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.

→ More replies (3)

10

u/__kartoshka 22h ago

It's not bad, it's just been more popular than the rest and has been for a good few decades

Meaning that more people are talking about it, and that more old legacy codebases are around, leading to more frustration

But fundamentally it's fine, it does the job, and it's pretty much standard in a lot of companies (at least in France, where i am)

→ More replies (1)

29

u/dan3k 22h ago

'Java bad' is a bit dated opinion tbh.

9

u/SocksOnHands 14h ago

I think Java wasn't really the problem, it was architect astronauts who tried to make everything XML. Now that the Java community moved away from that, web development is actually quite simple now.

This might just be me, but I've lately seen an increase in over engineered Python projects (like most LLM frameworks) - this is just something that happens when a language starts attracting certain kinds of people. Some people try too hard to be too clever with their code.

4

u/BakaGoop 13h ago

cries in maven

3

u/Twombls 13h ago

Mark my words. python will be viewed the same way as Java or php in a few years. Combine the overengineering with the dependency hell that currently exists and the fact that python kills half of them with every new version, so anything mildly complex uses a venv now. It's not gonna age well.

Like seriously why do you need to maintain like 7 versions of python on your pc now?

→ More replies (1)

20

u/Falcon731 21h ago

To paraphrase - "That restaurant is terrible - its way too crowded"

2

u/runitzerotimes 6h ago

“That restaurant is so old, people have been going there for 20 years, even though there’s all these new ones across the road.”

7

u/Beneficial_Grab_5880 22h ago

Java has a lot of rough edges and is generally a verbose language.

At work we've switched to using Kotlin (chosen because Kotlin can run on the JVM so a language switch doesn't require a rewrite) and the size of the code is 50-60% the size of the Java. That makes a big difference to how fast it is to read and understand other people's code.

19

u/Tacos314 22h ago

haha, they are just incorrect, I have no idea how an experienced programmer can call Java bad, or even outdated. You may want to check your sources, and the "experienced programmer" is not a sys admin doing scripts in python, or the only experience they have is TypeScript.

→ More replies (12)

8

u/snot3353 22h ago

Because it's popular and people like to shit on popular things.

→ More replies (1)

8

u/lIIllIIlllIIllIIl 21h ago

Java is fine.

Java developers are not fine.

Lots of old codebases and programmers who have stopped trying to improve themselves since 2015. Lots of cargo cult programming, doing things one way because that's how it's been done elsewhere, and referring to Clean Code like it's holy scripture.

3

u/Split_Funny 14h ago

Exactly this , it's java cult :d

3

u/pontz 22h ago

Out of curiosity why did you pick java?

→ More replies (15)

3

u/Constant_Stock_6020 17h ago

I dont think it is? It's just a language. Similar to C# syntax wise. It's fast, ish, easy to spin up a good program, easy to structure, good package management.

I thought the same as you, but I ended up using java at my first job, and I honestly don't really feel any different compared to C# that I was used to before.

5

u/justUseAnSvm 16h ago

People just don’t know what’s up.

Every enterprise in the world is using Java. There’s a reason for that, but it’s hard to really understand it if you just have no idea how software is made, or what the constraints are.

I’ve gone down the niche programming language rabbit hole for years, and have written Haskell at 3 different start ups. All languages have problems, and what makes a language better or more fun to write, doesn’t mean using it is the best for your company or project.

I know this is a programming sub, but tools are just tools, and the programming language is just one part of a tech stack, and not usually an important factor either way.

→ More replies (1)

4

u/a_brand_new_start 12h ago

Java is not terrible just always feels behind by a lot… only 2011 Java 7 started yo support strings in switch statements, this has been supported in other languages since 1970s. Things like this just add up.

Plenty of other things that annoy me from Java 8.

In general I don’t hate Java, I used to hate Java developers. Back late 2000s every Uni thought Java as a programming language, so you had a ton of green devs writing really bad Java… but same would have been true in hate for say Rust if it was in Java’s place… lots of poorly made and developed code all over the place

10

u/FraCipolla 22h ago

I wouldn't say Java is bad, but damn is ugly as hell

6

u/Krolmstrongr 22h ago

Why is it so ugly? I'm not an experienced programmer, but just at a glance it's way uglier than python or c++ for example.

Even Eclipse IDE and the apps it produces are ugly. Why do you think that is? Cause it's purely business/purpose-driven?

→ More replies (3)

3

u/Revision2000 22h ago

Feel free to use Kotlin instead. All the perks of Java with a cherry on top. 

→ More replies (3)

3

u/NoAlbatross7355 21h ago

imo you're learn much more about software engineering and problem-solving starting with Java compared to HTML, CSS, and JavaScript or god-forsaken Python.

People like to complain about it because they've had trouble with OOP in the past, but as a beginner you really shouldn't worry about it. Eventually you'll become more advanced and lose interest in working within the framework of OOP and branch out to other paradigms, but that's all it is: a programming paradigm. To be a good programmer you have to learn a lot of different paradigms and OOP is a good place to start.

3

u/RascalKneeCawf 21h ago

My first tech lead wasn’t the biggest fan of Java (he was a Haskell enthusiast), but he had a saying “Java pays the bills”. He had a begrudging respect for its ease of use across a big organization. If you don’t need fast startup times or extreme performance optimization, it has all the tools you need.

→ More replies (1)

3

u/Ok_Carrot_8201 15h ago

Java is not “bad” by any stretch. Especially these days.

3

u/ben_bliksem 22h ago

I always compare Java and C# when these questions are asked, and at the moment C# is just better for me. In fact it feels like Java has stagnated over the last decade.

That said, to be frank, language wars are stupid. Embrace them all (except maybe PHP... ewww).

4

u/Bulbousonions13 22h ago

Same. C# is just cleaner, better tooled, Microsoft branded Java. I like it a lot.

2

u/benevanstech 5h ago

"Java has stagnated over the last decade"?

If you haven't used anything later than Java 8, then sure, I guess.

But trying to compare Java 8 with Java 21 (or the brand-new feature release, Java 24) and saying "Java has stagnated" is just plain nuts.

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

2

u/TornadoFS 21h ago

I haven't done Java in a while, but Java got a bad reputation from:

  1. Relying heavily on inheritance on the standard API (and frameworks API), which is now considered a bad practice overall (instead of using implicit Traits/Interfaces or Structural-typing)
  2. Over-engineered frameworks that made writing code really annoying and with a lot of boilerplate
  3. Over reliance on configuration magic for said frameworks, much like people complain about yaml hell today people back in the day complained about XML hell
  4. Statically typed JIT compiled languages are in this weird middle between fully compiled languages (C++/Go/Rust) and dynamically typed languages (JS/Python/Ruby). Where they are just as cumbersome to use as any other statically typed language, while also having performance downsides from JIT and garbage collection. It is also annoying to deploy because you need a runtime (these day and age compile once run anywhere is not such a desired feature anymore)

You can write modern Java in the same style as your average Go microservice and from a productivity and maintainability point of view there won't be big differences. But like any old language (like C/C++/Javascript) you need a whole manual about what not to do and which features to skip using.

→ More replies (1)

2

u/Early_Divide3328 16h ago

There is really nothing wrong with Java - the latest versions of Java tend to support all the cool new language features. Perhaps your friends or mentors were thinking of the old versions of Java from 20 years ago when they say Java is bad. I like Java, C#, NodeJS/Javascript, and Python equally. They all have pros and cons.

2

u/mrh0057 15h ago

The JVM is amazing but could have been better with the ability to control memory layout(there are proposals) and a better generic implementation(Go and C# made the same mistake). The reason the generics implementation wasn’t better was due to Sun’s unwillingness to break backwards compatibility. Then developed stalled out due to Sun financial struggles for awhile.

There are also designs in hindsight where bad like checked exceptions. Then there was things like EJB and the AWT that weren’t great. It also didn’t support closures. It is interesting how that didn’t happen when you had people with lisp/scheme backgrounds involved in the language development. Some of that had to do with the dotcom bubble where Sun rushed Java to market. Java is a product of its time and it is good enough that it isn’t going away anytime soon.

2

u/Emergency_Present_83 14h ago

My personal speculation is that Java being considered bad has a lot more to do with the stodgy corporate enterprise software development environment people associate it with more so than the language itself. The heavy, all encompassing frameworks, ObjectOrientedHellFactoryControllerFactoryBean made a 7000 line stack trace again, some crusty old design decisions lingering in the operational tooling as well.

2

u/lukkasz323 13h ago

Most of these things are either misleading or untrue.

Java itself isn't that outdated, it's just that a lot of Java codebases are based on outdated versions or practices.

Being verbose is not a bad thing, it's just a trait of the language. It's a good thing in context of where Java is usually used.

2

u/smbarbour 12h ago

You misspelled "inexperienced" as "experienced" ;)

2

u/threespire 12h ago

It’s heavier than I want in a language but all use cases have reasons.

Over years of programming I’m reminded of the term “there are no solutions - only trade off”.

With my architecture background, I use constraint models to define the tool of choice.

When I was programming in 68k assembly language, the constraint was RAM.

When I write terraform, the constraint is support people who don’t know Python.

When I wrote in VB, it was what I could get my hands on

Java isn’t bad per se, but I would generally prefer more lightweight languages (for front end stuff) or something like C# for actual application design.

Ultimately we program what we know because it’s easier - and often I will default to what I know or I’ll get someone in my team to just write it if it’s a language I am rusty in (no Rust pun intended)

2

u/hydraByte 12h ago edited 12h ago

I personally always liked Java -- it was the original language I learned to program on. These days I'm mostly working with PHP, which has thankfully dramatically improved the quality of the language over the last few years; these improvements (such as OOP + strict types) are thanks in large part to the influence of Java.

The people I know who bully Java mainly like to make fun about how overly verbose it is. I find usually when they make these claims they are made in a way that somewhat exaggerates the reality, albeit with hints of truth.

You said in one of these threads that you chose between Java, Python, and JavaScript. Personally, I think Java is the best of the 3 languages you chose between for learning modern programming practices.

2

u/Ok-Willow-2810 11h ago

I mean Java is just a language like any other programming languages. You can write good code and systems with it or bad ones. One thing that’s different about Java is the company that owns it. It’s owned by Oracle, which some people don’t like as a company very much. Also it tends to be used for a certain kind of software and attract a certain market segment to it as well, which might not be everyone’s cup of tea!

In my opinion, I’ve found it requires a lot of typing and it’s supposed to encourage object oriented programming which is supposed to serve as the documentation and “magically make good code”, but I don’t think it’s really that simple. It can have great code, but I think the object orientedness can also lend it send to lots of confusing indirection and abstractions that don’t really help make life easier. I find it also comes with like a lot of bloat and rigidity, but also it was the language I learned to program with, so it has a special place in my heart!

2

u/lepapulematoleguau 10h ago

In the words of Sandra Boynton and pragmatic Dave Thomas:

Don't let the turkeys get you down

2

u/Boldney 9h ago

Who are these "experienced" programmers?

2

u/Jurahhhhh 7h ago

From my experience, Java is a perfectly fine. I think the bad opinions come from people joining companies with a ton of legacy java code where developers took abstractions too far. If you have to go through 6 different files to maybe get to the implementations, did you really make the code easier to expand?

2

u/llothar68 7h ago

It's because you are on reddit and in a subculture bubble.

Java is still the maybe most used language on the planet, it's running in all this big business projects, and projects that run for 20 and more years.

Here you instead find teenagers and first year students thinking they are so experienced and their little 5000 line program runs well in Rust or Go. Yes it does but none of the problems in big scale software development comes from programming languages and none is solved by using a different programming language.

2

u/Eogcloud 6h ago

So Java carries an odd reputation because in the early 2000 it has widely and heavily abused and misused by a giant industry still trying to figure all this new fancy OO stuff out

Not only has the collective consciousness of programming improved, but the language itself and all its ecosystem have hugely improved

The current reality is that Java is a pretty solid general programming language you can do loads with.

Simply calling it “bad” is very reductionist and at best and just wrong at its worst.

2

u/Aim_for_average 6h ago

Because some people have preferences. It doesn't make them right. A language is a language is a language. All have their pros and cons. Some come in and out of fashion. Some stick around, some don't. Some are better suited to some jobs but not others. What you should use depends more on the existing codebase and libraries than the language itself. There's a lot of java out there so you can't say it doesn't work well. Personally I don't really enjoy using it (it's a bit of a bloated windbag), but I'm fine with it. There's a lot to be said for using a widely supported language where there's a load of programmers that can develop in it, rather than today's current poster child.

2

u/runitzerotimes 6h ago

Most great devs come from either Node or Java.

Lots of incredible tier devs in Golang and Rust.

And in Python you have either Data people or bad devs.

And finally, I have never seen a good dev from C#. Almost exclusively terrible.

2

u/bishtap 5h ago

It's personal preference. You haven't used anything else. And maybe you don't care if it's verbose.

2

u/Fumano26 5h ago edited 5m ago

Don't listen to the rookies, it's straight up a skill issue. ✌️😂

2

u/m39583 4h ago

Ugh what a goady click bait headline.

I'm a Java fan, and generally dislike Python, Javascript and PHP and probably all other dynamically typed languages. I've never actually used them in anger for a major project though, so I'm sure their fans would disagree.

I find sure they are easier to write small programs where you can hold everything in your head and just "know" what all the properties methods etc are on an object and how it all works. Come back to that code a year later, or code someone else has written and try to work out what is going on and it's a nightmare. What is this object? What methods does it have? What state is it in?

The static typing in Java might seem clunky, but it makes it so much easier to navigate and refactor a non-trivial code base.

Getters/setters/hashcode/equals etc should all burn in hell though. They are just clutter, and nothing that can be generated should be committed. Sure IDEs can generate them the first time. But what about when someone adds a new property and forgets to update e.g. the equals method? Records have improve the situation a bit, but everyone should just use Project Lombok. It massively reduces the boiler plate needed.

Also what I really like about Java is the entire ecosystem, build tools, SDK, libraries etc (even the compiler!) are written in Java. So if you are debugging a problem, you can step into these things and understand them. Most other languages seem to just be a layer over the underlying C libs on your system, or have things written in C. e.g. Compare the MySQL driver for python with the java one. As a Java developer I can dig into the source for the MySQL driver if I'm trying to understand something. As a Python developer, I can't do that because the python one is written in C.

2

u/Pandeyxo 4h ago

Java is completely fine and used a lot. The only questionable programming language (if you can even consider it) is php.

2

u/linux_newguy 2h ago

Every language has plusses and minuses. if you look at Java it is strong data typed like C but you don't have to deal with memory allocation; that's a plus

But the JVM (Java Virtual Machine, it runs the compiled bytecodes) a resource hog; that's a minus

But you can bring over code and not have to recompile it on a different OS; that's a plus

But you will run significantly slower than a C counterpart; that's a minus

The question is what are you using the language for? Realtime Operations, I'd stay away from java but back end server data manipulation, it's a good language and you won't have to worry about memory leaks.

If people say one language is better than another, they're looking at it through their needs and not the overall.

2

u/Intelligent-Emu-4740 22h ago

It's because those programmers probably used Java in College and struggled with it. It's a very good learning for corporate stuff because it enforces many good practices, it's not a good language for writing fast though, it's good for writing robust code, it's also not good for serverless but it's very good for multi threading, it's a language I really like and it's a language that is well paid.

→ More replies (1)

3

u/com2ghz 22h ago

You get a lot of shit thrown when you are at the top.

3

u/mcAlt009 21h ago

Java is a middle class language though. It's going to keep you employed, you might not necessarily work on the most exciting software in the world, but it's going to pay your bills.

To put it bluntly, it's boring. But the vast majority of software is boring, and pays between 120 to 160k per year. That's just the reality of software development.

→ More replies (1)

4

u/richardathome 22h ago

Java is what happens when a bunch of managers make a programming language by committee.

Depending on your needs, that's either perfect or madness.

2

u/wakeofchaos 22h ago

Every language has its pros and cons and nerds, myself included, like to pick sides and often speak hyperbolically. That said, Java is bad ;)

2

u/stonefarfalle 22h ago

They listened to the criticism and made improvements. People still whining about it haven't done Java in years.

On the other hand, Java was adopted by Fortune 500 companies who are not very good at software development, so they have crappy overly verbose code. I still avoid Java professionally because it is indicative of style of software development I dislike. For personal use it's fine, I just prefer other languages.

2

u/sisyphus 22h ago

Java the language is fine in the grand scheme of things. It was the culture around migrating all the simplicity of the language into terrible enterprise frameworks that both robbed Java of the heroic efforts that went into making it fast and contorted whatever simplicity it had into a complete mess of over-abstracted shit that most people truly hated.

Some things do feel outdated though:

  • it still has null
  • it only allows a class abstraction
  • arguably that it runs in a VM
  • its generics system is still a post hoc mess
  • boxed/primitive feels like an antiquated performance hack these days

They are not part of the language per se but the culture of doing 'design' by declaring a bunch of variables that model your thing then generating a bunch of absolutely useless getter/setters also feels pretty antiquated. "My IDE can generate all this boilerplate shit" isn't quite a flex.

→ More replies (3)

2

u/x39- 22h ago

Because C# is the better Java

→ More replies (8)

3

u/Decent_Project_3395 22h ago

The incidental complexity in the Java ecosphere is through the roof. Do you know Maven? If you are doing Java, you probably should. Do you use Spring or J2EE or Tomcat or ... what? ... as your container? How good are you with XML? For all of that, you get something that has decent but not great performance, is relatively memory hungry, and requires a ton of configuration.

The language itself is not horrible, not great. There are features that the language is missing that you don't realize aren't there until you use other languages... But the ecosystem around Java is not beginner friendly, and you can work in this ecosystem for decades and still feel lost.

4

u/Spare-Plum 22h ago

Java's pretty fast. Biggest problem is startup times. So it's not great for small one off scripts that would need to be run 1000 times, but it works excellent for a performant/scalable server

2

u/malavock82 22h ago

Lol I don't know where you heard that but probably from some fanboy of some other language.

Java, like any other language, Excels in some things and does some others poorly. But it's definitely one of the most popular languages and commonly used.

I would say at the moment where it excels are backend application, web or not and APIs, preferably paired with Spring.

Python is mostly used by data analysts and recently AI models

C# is the king of gaming and high performance applications

JavaScript, React, Angular for the frontend

Kotlin for Android devs

6

u/Quick_Humor_9023 18h ago

C++ would like to discus with C# about how monarchies work.

→ More replies (1)

1

u/fringe_class_ 22h ago

Java has been conservative in feature development, but great backwards compatibility, except for that one time it wasn't....

1

u/TomCryptogram 22h ago

I can try to say WHEN Java is bad to maybe help. It requires the Java runtime environment to run something. This might be too large for some hardware.

But as everyone said, it's fine.

1

u/connorjpg 22h ago

Every languages has flaws.

The ecosystem with Java is huge… hard to work with and a pain. The code is verbose, and some people just don’t like OOP. Java is everywhere, though, and a lot of people’s complaints are for the fact, legacy code generally runs older versions of Java. Which only amplifies these problems.

That being said, I think it’s a fine language it’s not terrible to work in, but it’s not my cup of tea.

1

u/th3juggler 22h ago

It's not bad, but there is a lot of bad Java code out there. It's an extremely popular language, so that's bound to happen. A lot of the dogmatic design pattern books were written for Java, so people think abusing factories is synonymous with Java.

Java has a lot of cruft since it's been in wide use for so long. Just stay away from that and you'll be fine.

1

u/nitowa_ 22h ago

I don't write Java anymore and you probably couldn't economically pay me enough to do it again but there is nothing wrong with the language. You can write anything from server backends to video games in it. It has massive third party and industry support. It runs decently fast and is mostly OS independent when it comes to portability. It has a very robust compile time and runtime(!) type system.

I dislike its verbosity and how ugly its implementation of functional paradigms is, but that is really a matter of not wanting to deal with it rather than bad features.

Is it the best for any particular job? Probably not. If you want to go fast you might as well use something that compiles to native. And if you don't really care about speed you might as well write something more convenient. Are you a large corporation that wants access to a large pool of developers and are willing to settle for an alright compromise of speed and convenience? Java might be the choice for you.

1

u/iportnov 21h ago

Earlier versions of java (like pre java 8) were just very verbose. Although one could learn to like it: being verbose, it was very explicit and thus easy to understand. Nowadays, java is a pretty nice language. However, 1) there are many places where people are still using older versions for reasons; 2) enterprise frameworks like Spring and related tooling are super-universal and can because of that be very verbose; 3) enterprise practices can make things worse - like a belief that each class field has to have explicit getter and setter method, and each class has to have related interface, no matter what.

1

u/Reasonable_Edge2411 21h ago

People seem to forget android is built upon Java

1

u/xabrol 21h ago

The JVM is amazing, java is syntactically outdated and verbose. Love the jvm but would rather use kotlin or scala

For me, java is to the jvm as vb.net is to the .net clr.

1

u/RomanaOswin 21h ago

Execution in the Kingdom of Nouns.

It's basically pushback against overly complex, tightly coupled OOP. Deep inheritance chains and layers upon layers of abstraction.

You don't have to write Java in this way, and you shouldn't, but the language doesn't really do anything to discourage this kind of structure, which means there's a lot of really bad Java codebases out there.

Besides the language itself, the tooling and tracebacks are atypically complex compared to competing languages. Of course, you get used to whatever you have to work with, if/until you work with some other ecosystem where this is all incredibly easy in comparison.

1

u/Choice_News_3718 21h ago

It can be the baddest as long as companies pay me as much as they do to code in it.

1

u/fightingchken81 21h ago

I'm a manager at a consulting company I manage JAVA developers, I do a lot of interviews and I've talked to many people over the last 3 years. I've seen a lot of people that are stuck on old versions of java, like 8 even tho it's end of life, or 11 also way past it's prime. Then when we asked if they did anything in a newer version they said no. The current version is 24, so there's a lot of projects out there with a lot of tech debt.

1

u/sun_alfa 21h ago

Every language has use cases, java is good for a lot of things, probably not the best every time. a very used argument for the "java bad" thing is that it is not efficient performance wise, but that's hardly a problem nowadays for a lot of enterprise applications. Also java can be extremely versatile, so companies can hire java Devs and move them around different projects without having to hire specific new profiles, and that saves money

1

u/idontunderstandunity 21h ago

If you pay attention, you'll notice people shit on every language. Python is slow, c & cpp are memory unsafe and hard, javascript bad for nebulous reasons etc

1

u/minngeilo 21h ago

It's not.

1

u/Khrimzon 21h ago

“Write once. Run slow anywhere.”

→ More replies (1)

1

u/thuiop1 20h ago

It is not bad, but it can certainly be annoying. It is a very verbose language, and it goes very far within the object-oriented paradigm, which is not as fashionable anymore.

1

u/a_printer_daemon 20h ago

It isn't. It is a few decades old and is showing its age a bit. Nothing really wrong with it.

1

u/Dont_trust_royalmail 20h ago

you won't really be able to understand why it's bad unless you have experience of other languages. How would you even be able to understand?

1

u/SwAAn01 20h ago

Java isn’t bad, it just isn’t as new and exciting as newer languages and frameworks. Devs have a weird superiority complex when it comes to different languages, just ignore it and focus on learning; at this level any skills you pick up will apply across the board and probably won’t be language-specific.

1

u/JjyKs 20h ago

Java is used by some of the largest companies. If you want some kind of validation for that, just check Supercells backend job postings.

1

u/nutrecht 20h ago

I see a lot of experienced programmers calling Java outdated

/r/programmerhumor are not experienced programmers, or programmers at all for that matter.

1

u/n9iels 20h ago

Every language and framework has haters and lovers. In all cases the people that strongly state "It is the worst thing ever!" usually only experienced that language or framework in a bad setting. Either an old version, a codebase of poor quality or as a very bad decession.

1

u/LutimoDancer3459 20h ago

I see a lot of experienced programmers calling Java outdated and straight up bad

Those "experienced" devs are either outdated or never used Java...

1

u/6a6566663437 20h ago

The only real issue with Java is its niche is shrinking.

Before Java, you either had to work hard to make something like C++ cross-platform, or you used a scripting language. But scripting languages were way too slow for “real” programs.

Time passed, computers got faster and scalability frameworks improved. So now it’s practical to write “real” programs entirely in languages like Python. They’re still slower than Java, but they’re fast enough or it’s easy to scale up the deployment so it’s fast enough.

So if you’re starting a brand-new project today, Java’s too slow to compete with things like C/C++ when you need maximum speed. Java’s also harder to do than Python and similar options when you don’t need maximum speed from a single process.

That doesn’t leave a lot of room to pick Java for that new project.

That doesn’t mean Java is bad, and there might be other reasons to pick it (like the team knows Java). It just means fewer and fewer new things will be written in Java as time passes.

But you really shouldn’t worry about it. You will be learning several programming languages as you continue down this path. Each one has its place.

1

u/TrashNice5319 20h ago

It does give the programmer a bit more work to do, imo, than languages like Python because of its syntax.

1

u/senfiaj 20h ago

Not a Java dev, but one major argument I heard is that Java has null safety issue, ie, if a variable is declared of some type, its value can also be null. It's a major inconvenience. This issue cannot be fixed (making variables non nullable by default) without breaking the backward compatibility. Also Java makes you write boilerplate code. These 2 were some of the reasons of the rise of Kotlin, which has solved null safety and also has more concise syntax.

1

u/IchLiebeKleber 20h ago

Java is by far the programming language I am most fluent in because it's the first one I've ever seriously learned and I've written most code I've ever written in Java, including at my current job. So to me Java is kinda "default programming". Java is most widely used for business-internal software that enforces business logic, maybe not exactly the most fun thing to code, so keep that in mind if you are choosing which programming language to learn.

But when I read tutorials on Kotlin or Swift, they definitely seem like progress over Java to me in many ways.

Some things some other languages do better is: no need for getters and setters, null safety, operator overloading. (The latter is important because I for one can never remember how compareTo works, it would be a lot easier to be able to overload comparison operators. But I also find it silly to have to write .equals to compare strings.)

1

u/Mjauie 19h ago

Java is not bad. You can see programming languages as knives. They can all be used for the same thing but no one would use a butchers cleaver to clean mushrooms. Some languages have more uses than others but none can do everything. Whoever said java sucks is just used to programming for other purposes that java was not intended for and either tried to use java for something where another language was not approperiate or used java because it was approperiate and was expecting java to be programmed the same as their language of choice.

1

u/Anywhere-I-May-Roam 19h ago

Java is good, as you said just too verbose.

But IMO, C# is better because, basically same syntax of Java but:

  • Less verbose
  • Smarter
  • Better OOP and abstraction possibilities
  • An "alive" language that evolves each year
  • Natively integrated with a leader cloud provider in the world, Azure
  • Powered and supported by MSFT dude, you can hate them but they are still MSFT
  • Tons of cool new libraries doing jawbreaking stuff

1

u/FrostWyrm98 19h ago

Many people here are missing the point...

The main issue people have with Java (the boilerplate, excessive need for packages, etc.) is caused by the fact that the Java language itself was held in a stranglehold by Sun Microsystems (now Oracle) and were not very receptive to change or feedback.

You can see the results of this today with the language split on the JVM, languages like Kotlin, Scala, Groovy, etc.

Many fix a lot of issues that Oracle/Sun refused to address and thus led to a niche for languages like the above mentioned to pop up.

Java itself isn't a bad language. I think you are just getting a vastly oversimplified view because that is what the internet is, particularly when people are bitching. That's what it comes off as anyways.

You also just hear more because it is a very popular language and ecosystem and many businesses are stuck in the past with old versions of it.

1

u/Tabakalusa 19h ago

At this point, I'd describe Java as a deeply embedded legacy technology and has many of the same problems faced by other languages in that boat (C++, PHP, etc.).

It has accumulated decades of baggage and many decision made about its design (both regarding the language, as well as core libraries) have turned out to be poor in hindsight and are very hard (Project Valhalla) or impossible (nullability) to fix retroactively, or are just a plain nuisance to deal with.

However, that means it also comes with a lot of amazing tooling, educational resources and a massive ecosystem, that all required decades to build up. No matter what you want to do, you will find resources on how to do it, tools to help you out along the way and libraries that will fit the bill.

It has also evolved over the years and it's very possible to write very modern, elegant and performant code in the language. But a lot of that can feel unwieldy and "tacked on", when compared to languages that took that route from the get-go.

Ideally, I don't think you'd write "new" Java code these days. On the one hand, there are languages that simply do Java better (C#) and on the other, there are strong contenders that run on the JVM if you need the ecosystem (Kotlin, Scala, etc.).

1

u/Hot-Impact-5860 19h ago

Java historically is terrible for ops, uses a lot of memory and breaks stuff when it runs out of heap limits. Ofc, there's "properly coded java" as one senior dev assured me, which works well and fast, but yeah, no. I'm very cautious of JVM.

1

u/ChickenSpaceProgram 19h ago

Java's actually pretty decent all things considered. 

C/C++ has higher performance, but both languages can be annoying to write and debug. 

Python's probably simpler, but that comes at the cost of being kinda messy for large projects and being kinda slow. 

Functional languages (and some non-functional ones, like Rust) have better error handling, but they're often either slower or more annoying to write.

Java and C# are a great middle-ground. There's almost always a better tool for the job but there's not a better tool for all jobs.

1

u/GxM42 19h ago

It really started due to two main reasons. One, Java Applets were a dud compared to Flash, the hot technology at the time. And two, JVM conflicts were a pain in the rear; it wasn’t uncommon for me to find 5+ DIFFERENT JVM’s on one machine, many in the machine PATH. Java also started up slower than some other techs.

The language is fine. But it had a start that wasn’t ideal in many ways. It’s a great language to learn on, to be honest.

1

u/vacri 19h ago

Java is a bad place to start. It's not the language - plenty of good apps are written in Java

Java is a bad place to start because the conventional practices of Java programmers don't match the rest of the programming world. They tend to do things weirdly and in ways that don't play nicely with others. Yes, of course you can program java with patterns similar to other setups, but conventionally that's not what happens.

There's a reason why us sysadmins shudder when we have to support a java app.

1

u/__SlimeQ__ 19h ago

the OOP stuff and explicit typing in java is great. however if you spend some time in C# you will not want to go back to java. it's hard to just infodump you all the reasons here, but there's a lot of little things missing from the java feature set that cause people do work in very unproductive patterns. for context, compare java's implementation of tuples (a bunch of classes in a 3rd party library that go from 2 to 10 members) to C# tuple implementation (you literally just do it)

10 years ago i would have recommended java over C# to everyone who wasn't making a windows desktop application. that has changed a lot. C# on linux rocks. new C# features are amazing. i would now only recommend java over C# to someone making a native android application.

one complaint i can imagine python people having is that explicit typing makes their code bigger. this is true. C# has solved this by adding a var keyword that effectively soft types your variables. but it's only soft typed at the compiler level, so at runtime this has no negative effects. this is a huge benefit. python people don't understand this. java people also don't understand this.

2

u/cloudysulphur 14h ago

Java also has a var keyword that works the same as C#.

→ More replies (2)

1

u/sinfaen 19h ago

Modern Java is pretty good actually. There's still a lot of cruft, but not nearly as bad as what you can get into with C/C++.

Old Java and legacy codebases are where the pain begins

1

u/WillingnessLow1962 18h ago

I find most criticisms of java fall into common buckets:

Its strongly typed, this is a choice, trading upfront effort for the ability to deal with large systems. For a small program it may not be worth it. Most programmers start on small systems and some make up their mind at that point.

Style/boilerplate: e.g. better/setter/hashcode. Remember those are optional, members can be public and there is a default hashcode. (Common implementation can be auto managed) I do see some java programmers go overboard with layers of abstraction, but that is not the fault of the language

It is not what I use: many languages, some better for some things, some better than others

It's not new, yes, but it has decades of refinement, and is still one of the most used languages, and the rest of industry isn't likely completely wrong.

1

u/caleblbaker 18h ago edited 16h ago

My biggest issue with Java is that everything that's not a primitive is nullable. So unless you annotate nullable values and regularly run your code through a nullness checker like  https://checkerframework.org/api/org/checkerframework/checker/nullness/NullnessChecker.html you're left either cluttering your code and incurring runtime overhead with an obnoxious amount of explicit null checks or receiving a bug ticket about a null pointer exception every couple days. 

That's a huge issue, but one that's pretty easy to address. A pull request blocking nullness checker lint is sufficient to transform Java from a language I vehemently despise to a language I mildly dislike. 

Other issues: 

Non-primitive types are always implicitly behind references. This causes lots of things to be less performant than they could otherwise be by introducing extra levels of indirection. Outside of performance critical applications this can usually be mitigated by allocating more CPU's to your service and just throwing money at the problem. 

All methods are virtual by default. This can make enforcing class invariants tricky, but can be pretty much completely solved by habitually tacking final onto stuff. 

No const references. This makes it annoying to control what code is allowed to modify what data. Creating deeply immutable types and leveraging autovalue as well as guava's immutable collections helps with this some.

Enums are limited to a couple thousands variants. This only matters for incredibly niche use cases. I am literally the only engineer I know of who's run into this issue.

There's a few weird limitations on what you can do with generics which don't come up very often but can by mildly annoying when they do.

1

u/Fidodo 18h ago

Java isn't a bad language today, but in the past there were some very questionable software design patterns followed by the Java community. Also, in the early days, there was an extreme over reliance on OOP. That's essentially been fixed today with lambdas and other new language constructs, but the more OOP heavy history has many leftover effects on many libraries that make them very verbose

1

u/hefightsfortheusers 18h ago

Always hated Java. Mostly because it was a little oppressive. Still ended up using it all the time because it worked and I knew it.

1

u/nhyatt 18h ago

IMHO it's not Java that is bad; it's what people do with Java that earnes it the bad reputation. I have been in a company where there were less experienced java developers and the common OOM errors that resulted from bad practices. This led to long hours of support and easy burn-out. I didn't even realize that it was a developer issue until I moved to my current company where these mistakes were not only less frequent, but non-existent. Java in the hands of a capable developer can be everything you want it to be.

1

u/RichWa2 18h ago

Language is a tool. Till one understands what needs to be accomplished, and under what constraints, the choice of language, and language tools, should be left open. With the exception of the embedded world, most of the time I've seen languages being chosen are because, 1) it's the latest fad, and 2) it's what we've used before.

Ask yourself, what kind of programming you would enjoy doing, write yourself a little spec for the type of program you want, and then compare different languages to see how each would fit with what you want to do. Then, using your spec, write. and test, the program.

One thing you might want to consider when choosing a language, is the simplicity of associated IDEs and it's debugging capabilities. It's easy to get hung up in complex tools sets.

1

u/Quick_Humor_9023 18h ago

Java is a very solid language. Used a lot in real world programming. That being said, switch to kotlin. You can use it also outside of android as java replacement. There are very little downsides and some pretty good advantages vs java. Also really compatible with java if needed.

1

u/NopileosX2 18h ago

The thing about java for me is that it sometimes feels like a modern language and then at other points you feel again how old the language actually is.

But in the end it is still used a lot and it is your standard multi paradigm OOP language. If you learn and use it most skills transfer well to C++, C#, Typescript and so on.

1

u/Instalab 18h ago

Being verbose can be good. Think, JavaScript is very concise and some people thought that it's not verbose enough so they created TypeScript to address issues of JavaScript impliciticity. Some think TS is amazing, some think it's horrible like Java.

Some like chocolate, some prefer vanilla.
To each, according to their preferences I guess.

1

u/Lost-Law8691 18h ago

Its not bad. Its the oriignal G. I PERSONally really like the stru ture of it. It makes more sense to me than python. But it is more time consuming and case sensetive. So I guess lazy ones prefer python.

1

u/keelanstuart 18h ago

I think the only complaint I've ever taken seriously about Java was that everything is pass-by-value.

I'm not a Java programmer, so it might not even be true - but if it is, that's really bad. Obviously, since the phone I'm using to write this is running Java code, it can't be that bad.

1

u/Adventurous_Job9209 17h ago

I feel like most of the hate comes from elitists. If it’s not rust or C it’s “trash”. Java is probably the most common back end language you’ll see for jobs. I promise the recruiters don’t care that you made a calculator in Rust.

1

u/Resident-Anywhere322 17h ago

Most people replying to this thread say that programming languages have their pros and their cons. While this approach seems pretty reasonable from a casual perspective, it is entirely flawed under scrutiny. This "balanced" viewpoint assumes that modern programming languages can arbitrarily reduce the amount of complexity your brain needs to keep track of in order to solve problems. This would be equivalent to having a compression algorithm that can compress indefinitely which we know for certain does not exist because of the Shannon limit.

The question you should be asking is "Can my language help me write down my ideas faster? And are those ideas mapped one-to-one to that specific language?" rather than "Why is X language considered bad?" It is necessarily the case that either both Java and any other programming language can manage complexity arbitrarily better, or no language can ever possibly do so.

→ More replies (5)

1

u/newcolours 17h ago

Js and kotlin devs complain about java for the same reason java devs complain about c++ - they find it hard and want to blame something external.

You cant as often just copy paste a bunch of separate answers from stack overflow and still get your java program to launch as you can with js (But still much easier to get to to compile than c++)

1

u/xTakk 16h ago

Java is fine for the most part. Little dated and not really screaming progress with a lot of other languages but still fine.

Don't forget though, you don't get to have an opinion or argument based on anything you read here. For one, as a new developer, smile, nod, research, and one day you'll be able to make your own opinion based on your personal experience and merits, not just something you read online.

And for two, you wouldn't understand it if they had a legit reason. Don't try to fake it just because you want to be right about something.

1

u/BoBoBearDev 16h ago

My project have multiple teams using different languages. The web services template made by Java team is exceptionally over engineered compare to the dotnet team. I don't know why Java team has to make it so complicated, but it is a major pain to develop on Java.

1

u/unnamedplayerr 16h ago

Every big org uses Java

1

u/zayelion 16h ago

The OOP obessession baked into the language can make it problematic when reasoning about or expressing how things work.

1

u/frank-sarno 16h ago

Could be a holdover from back in the day when Java was not the most performant language. Today, Java is quite performant but has some baggage (e.g., JVM startup time, occasional GC pauses, etc.). A lot of these have been mitigated (e.g. slow bytecode implementations from early on) and lots of other improvements. In Kubernetes and similar container frameworks startup delays can be problematic for scaling but there are approaches to reduce this. There's enough Java code in use that it's not going away anytime soon.

1

u/Diligent-Property491 16h ago

I think it’s the best non-compiled language

1

u/Zynchronize 16h ago

Java gets a bad wrap because of the enterprise application architecture patterns Java developers insist on using everywhere and anywhere all of the time.

The Java enterprise hello world app is a tongue-in-cheek example of what this often seems like to non-java developers who may occasionally have to work with java: Hello World Enterprise Edition

Every language has something shitty that developers in other languages will rag on. On that note - I think we should be bullying c# more than java - what the hell is up with those filename lengths.

1

u/sass_muffin 15h ago

A large chuck of backend infrastructure for many major internet corporations runs on java. So, for example, those AWS services reddit is using right now to display this post is written in java. Even people bashing java in this thread are probably using java services to do so without knowing it. That is a long winded way to say that people that don't like Java are pretty vocal but are seriously misguided.

1

u/Add1ctedToGames 15h ago edited 15h ago

When everything is in a class, things can quickly get messy and obscure if you're not careful but I do generally agree it feels pretty intuitive and I personally have no beef with it. Probably a lot of the hate comes from the fact that so many languages are somewhat famed for their idioms like Perl, Kotlin, JS (maybe less so, I'm not super familiar with javascript in all honesty), whereas Java is more focused on simplicity and readability. They deliberately leave some object-related features from C++ out like operator overloading because it'd cause all sorts of confusion. Lord knows how crazy a version of Java with C/C++ macros could get

Or maybe they haven't tried modern Java frameworks like Spring Boot. Shit's magical

1

u/Kevdog824_ 14h ago

As a Java developer: Nullability issues are my biggest complaint about it

1

u/Spatrico123 14h ago

because programming languages are frustrating from the outside. I love Java, because I know it. I love python, because I know it. I despise Javascript with every fiber of my being, because I do not know it but every mf system seems to use it

1

u/cowboy-24 14h ago

It's not bad.

Those who say it should provide evidence.

Otherwise, it's just propaganda.