r/computerscience • • 8d ago

Discussion Cold take: Java has essentially zero flaws

I've posted here before about x86, and I'm back with another take that I recently learned is "objectively wrong" as my coworker would say.

Java as a language is object-oriented, which is ultimately great for a multitude of reasons. The complaints that people like to throw out about verbosity is mostly just paraphrasing for "i like syntax candy more than any kind of structured code".

Java is only bad if you write it bad. If you think it's a bad language, then you probably just don't have a great grip on OOP. I've never worked so well in a team in anything besides Java. The fact that people will hate on Java then give their love to Python blows my mind. Python is essentially a useless pile of junk when you compare it to Java.

Anyways, I'm open to argumentation. My coworker is trying to brainwash me into thinking that Java is the worst language of all time. But, it's not. It's the best.

0 Upvotes

42 comments sorted by

7

u/diemenschmachine 8d ago

Well for starters you cannot use it in for example an airplane flight controller.

We have many programming languages for a reason.

Just tone down your opinions a bit and I’m sure you’ll have less drama at work, and might even be taken seriously

1

u/4r73m190r0s 7d ago

What is the reason behind this? For Java not being used in aviation industry. Generally curious considering that banking industry is backed by Java, and they have strong requirements for stability.

2

u/diemenschmachine 7d ago edited 7d ago

Because it does not meet the safety standards required. Plus it is a garbage collected language which makes it unsuitable for MANY other applications, like for example games and other realtime applications. Banking systems run on clusters of servers, aircraft do not.

I'm an embedded software engineer if you couldn't tell, and it's completely unheard of to use java in any context whether the host system is bare metal or a linux OS. We use C or C++, and lately Rust is gaining popularity because it is objectively a safer language with a more modern packaging infrastructure and compiler. Sometimes we use scripted languages if performance is not important, but for any critical/core software it is C, C++, or Rust.

But Java? Lol, no.

-1

u/e221U 8d ago

Well, of course we have many programming languages for a reason. I'm not saying Java should be the only language, but I'm saying it's the most underappreciated language of all time. There's a reason it runs pretty much everything.

3

u/diemenschmachine 8d ago

What part about “It’s the best” did I misinterpret?

1

u/LanMan2746491 7d ago

definetely misinterpreted a lot. what he's getting at, and I agree, is that Java is definetely the best language in terms of versatility, and its wide usage only backs that.

1

u/e221U 7d ago

Couldn't have said it better myself.

3

u/iamirzhan 8d ago

tbh, I think that reason is history, not the greatness of Java.

5

u/4r73m190r0s 8d ago

Memory footprint and cold start are its biggest issues

3

u/Easy_Objective9142 8d ago

Java's memory usage is pretty rough for small services, I noticed that when tinkering with some backend stuff. But for big enterprise systems the tradeoff is usually worth it, nobody cares about 500mb ram when the app has to run for months

0

u/e221U 8d ago

I suppose you could make that argument, but they exist for good reason. Memory footprint is the tradeoff for being able to allocate heap objects at near-stack speeds. Cold start is the tradeoff for having a JIT that works on every device.

1

u/4r73m190r0s 8d ago

I suppose you could make that argument, but they exist for good reason.

Read this part aloud.

It's not about those features being unjustified or there without a reason.

1

u/e221U 7d ago

If those features are justified given the language, then they're not bad features.

1

u/IcecreamLamp 8d ago

Graal AOT compilation solves both of these issues.

4

u/Routine-Lawfulness24 8d ago

Even if that was true, not being bad ≠ being good

-1

u/e221U 8d ago

Some elaboration would help

7

u/goodnewseverybody99 8d ago

There's literally a Wikipedia page on this: https://en.wikipedia.org/wiki/Criticism_of_Java

0

u/e221U 7d ago

Wikipedia is an unreliable source.

1

u/4r73m190r0s 7d ago

Not any more. Try to edit any article and see how it goes, what is required from you.

0

u/LanMan2746491 7d ago

wikipedia is historically known as an unreliable biased source.

3

u/FancyMouse123 Researcher 8d ago

I hope this is sarcastic.

0

u/e221U 8d ago

This might sound crazy... but nope.

3

u/boformer 8d ago

The generics are quite flawed, e. g. no List<int> and other weird limitations.

The lack of structs is also extremely concerning. They are just about to fix that mistake, but it's 20 years too late.

Try C# for two weeks and you never want to go back.

2

u/e221U 8d ago

C#'s potential is ruined because of .NET. Also, primitive generics not being allowed is the tradeoff for backwards compatibility.

4

u/boformer 8d ago

Those are very weak arguments for "zero flaws".

1

u/e221U 7d ago

How so?

3

u/disposepriority 8d ago edited 8d ago

I mean he isn't wrong, type erasure in java generics is a pretty major drawback in today's day, saying this is a long time java dev.

Edit:
For context, I find this more annoying than the lack of stack allocated objects - which personally I think is irrelevant in 99% of cases.

7

u/MilkEnvironmental106 8d ago

Any language is bad if you write it bad. Verbosity is absolutely a drawback. Start times and memory footprint mean there are many projects it is just a nonstarter for many projects without very advanced tooling. Calling python useless when it's the most popular programming language and ubiquitous in data processing and ml reflects more on you than the language.

Java has many well documented flaws as well, the designers of the language got themselves into several pitfalls when designing the language that couldn't be reversed due to it being a breaking change.

It's greatest strength is it's specificity and popularity.

1

u/Magdaki Professor. Grammars. Inference & Optimization algorithms. 7d ago

Right tool for the appropriate task. Java is good for some applications, and less appropriate for others. Java is certainly not without flaws born from its design.

I teach the Intermediate Java and Advanced (i.e. graduate) Java courses at my institution. I say this not as an appeal to authority but rather I'm not anti-Java biases. For the record, my personal preferred language is C++.

1

u/e221U 7d ago

C++ is p much obsolete in this day and age.

1

u/GulgPlayer 1d ago

Not being Java doesn't make a language obsolete. In fact, it does quite the opposite

1

u/e221U 1d ago

You're creating a false dichotomy. C++ is obsolete because of pointer management, severe safety risks, undefined behavior, among many other things. Notice how Java has none of that.

1

u/LanMan2746491 7d ago

C++ is definetely not as important as it once was, and Java is the new "hip" with the kiddos.

1

u/Magdaki Professor. Grammars. Inference & Optimization algorithms. 7d ago

Meh.

1

u/__chicolismo__ 7d ago

Just out of curiosity: how many languages do you know ? 

1

u/e221U 7d ago

Multiple.

1

u/__chicolismo__ 7d ago

Just wanted to know which languages you're comparing it (java) with

1

u/Historical_Ad4384 3d ago

If you want to write servers, Java is what gets you there with everything out of the box

1

u/I2cScion 8d ago

I like Scala syntax .. leaner

1

u/__chicolismo__ 7d ago

I would argue Java isn't even the best JVM language 

1

u/FrancineTaffyQueen 7d ago

I don't think it's useful to have the argument, personally. Java isn't a bad language. Is it bad at certain things? Well yes that's obvious. You wouldn't use Java for everything.

But comparing it to another language that has a different focus and use case isn't a compelling argument either.

I always assumed that most programmers know more than one or two languages. It's still a little strange to encounter somebody that has only coded in one language for the majority of their career.

So maybe your co-worker's opinion about Java being the worst language just has to do with his perspective. Maybe he knows more than one language and Java is his least favorite.

We all have our least favorites. I prefer C/C++ and python.

I will always prefer C based languages just because I like the language itself. it matches the way I think and the way that I learned how to program.