r/computerscience • u/e221U • 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.
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
4
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
3
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
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/LanMan2746491 7d ago
C++ is definetely not as important as it once was, and Java is the new "hip" with the kiddos.
1
1
u/__chicolismo__ 7d ago
Just out of curiosity: how many languages do you know ?
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
1
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.
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