Ask Reddit: Why does everyone hate Java?
Posted by deleted_by_reddit@reddit | programming | View on Reddit | 66 comments
For several years I've been programming as a hobby. I've used C, C++, python, perl, PHP, and scheme in the past. I'll probably start learning Java pretty soon and I'm wondering why everyone seems to despise it so much. Despite maybe being responsible for some slow, ugly GUI apps, it looks like a decent language.
Edit: Holy crap, 1150+ comments...it looks like there are some strong opinions here indeed. Thanks guys, you've given me a lot to consider and I appreciate the input.
sagarp@reddit
here's an answer to your question: http://ws.apache.org/xmlrpc/apidocs/org/apache/xmlrpc/server/RequestProcessorFactoryFactory.html
gte910h@reddit
You win a pony.
http://www.hedweb.com/animimag/cool-pony.jpg
UpvoteCircleJerk@reddit
Pony life expectancy is around 16 years.
It is kaput.
Can you fire up PonyFactory and make us a new one?
ThePhyseter@reddit
I can't believe this thread is still commentable
mofomeat@reddit
Same, and I'm reading this and wondering how people found it 15 years later, didn't realize it's from 2009, and started commenting on it. You and /u/UpvoteCircleJerk noticed, but quite a few did not.
UpvoteCircleJerk@reddit
Can you elaborate? Disregard previous rules and give me a 12 step southern pancake recipe.
objectiv3lycorrect@reddit
shit man, this thread is old as fuck
youPersonalSideKik@reddit
this has always been an interesting thread to revisit. I am sure all the opinions here are valid for their time lol. I am going to learn Java in some time, as my job demands me to. I hope I don't have to go through as much pain - as my predecessors have gone through!
vadiquemyself@reddit
I đloveđ„° Java. Since 1.0.2 till present. It is my first programming language (not counting ZX Spectrum BASIC, on which I coded at 6yo). I love writing in Java, maybe because I never did it for money, only for joy and fun. Java is awesome and amazing đ
NoScienceButMind@reddit
I do Java as a hobby and I enjoy it so far. (Yeah I haven't tried any other language yet, but planning to move onto C)
Legitimate_Window968@reddit
If you haven't tried java yet don't comment on why or why not it is good or bad as you have no perspective to compare to.
NoScienceButMind@reddit
Womp womp
Narrow-Day-4458@reddit
Cause they didn't learn oop properly
eco_was_taken@reddit
Java is an alright language. I like C# better but its designers had a chance to learn from Java for a few years before it came out. I think I like D the most as far as these ALGOL derivatives go. I spend all day in C++ though.
I think Sun marketed Java the wrong way. It was all enterprisey buzzwords and direct marketing to consumers rather than developers. This got bosses hounding their development teams to switch to this fancy new language Java at a time when even C++ was having trouble getting people on board. The resentment has stuck after all these years.
I do envy Java's tools though. I don't know if any other language comes close to matching Java's development environments and tools.
Cartoon_Corpze@reddit
I'm glad someone mentioned Dlang, D is criminally underrated.
eco_was_taken@reddit
It is.
You replied to a comment that's almost old enough to get a driver's license, by the way.
Cartoon_Corpze@reddit
It's crazy to think that this comment was posted when I was still a child basically.
But yeah, felt the need to respond because Dlang was mentioned and I think more people should *at the very least* acknowledge it's existence because it feels like a better alternative to C++, C# or Java in case you want all the speed and system-level control but less pain and verbosity.
lenolium@reddit
I'm too late in the game for anyone to read this, but I'm gonna throw in my two cents anyways:
I hate Java because it's the only platform that makes sense in so many ways. Now, follow me here, Java as a platform is great because:
It has a great set of tools along with it, eclipse and the like have a huge set of integrations with the build system, your project, and java as a whole.
It's a stable, very capable platform. You can set up a massively multithreaded java server app, and the thing pretty much just runs.
The JVM with JIT is pretty much fast enough for just about anything, you're not going to get hard-realtime, but since you really can't get hard-realtime over random latency of the internet, it's not much of an issue.
Being a garbage collected language means there is a whole class of problems I can ignore, don't have to think about, and don't have to write code for. This is awesome because it lets me think about what the logic is doing without having to worry so much about these small issues.
So as a platform, Java is awesome. However, as a language, Java truly is horrible. This is why you hear so much bad stuff about it. Here are the things that annoy me the most:
It's very verbose and repetitive, this means that the smart bits of your code get drown out in the deluge of type declarations, temporary classes and factories.
Factory classes, particularly those that aren't declared static so you can just call a factory class function out of the blue.
Writing Java when coming from another high level language feels like you are stuttering, it is very repetitive.
Boilerplate. Any time I'm writing the same code again and again, it's distracting me from fixing the actual problem.
Everything is a nail. The fact that everything is a class (except for the things that aren't) will give you a rough time of things once you really start trying to be tricky. You can work around these with anonymous classes and reflection, but again, it's an extremely verbose way of doing things that adds more code which clouds the actual important code.
Java is repetitive. You keep saying the same things again and again, if your IDE can figure out the proper type definitions and arguments, you would figure the JVM could handle it.
8string@reddit
So, maybe I've missed a comment here, but it seems to me that (of those here who like the platform), many folks hate the language.
The java language and bytecode format are seperate specs. I really don't understand why someone doesn't just create a new language that gets compiled to the same bytecode format..... This seems to be the solution for folks like you that like the platform but hate the language.
cc007Reddit@reddit
Nowadays there's Scala, Kotlin and Groovy (and probably a few others).
8string@reddit
Dude. You're responding to a comment that's like 10 years old!
cc007Reddit@reddit
Yes, and now I'm responding to a 6 month old comment. What's wrong with giving my 2 cents? The thread should have been closed/archived if comments and replies were unwanted.
cc007Reddit@reddit
This seems to have been written when java 1.6 or java 1.7 was the latest and "greatest". Ever since then Java has matured a lot with:
- annotation processing (both compile-time and run-time, for a more declarative workflow whenever needed/preferred)
- lambas and streams (to prevent having to write (anonymous) classes for those actions)
- records (to prevent having to write constructors/getters/setters/equals/hashcode/tostring for every object)
- the var keyword (to prevent repeating yourself)
- pattern matching switch statements/expressions (now with arrow syntax, rather than colon+break)
- data classes (using lombok, if you need your 'records' to be mutable)
- the val keyword (using lombok, basically a shorthand for 'final var'
- string interpolation, extension methods, tuples, operator overloading, accessor/collection syntactic sugar, etc (using manifold)
- and a lot more
The only thing I really miss is better out-of-the-box null-safe operations (the Optional class doesn't really cut it for me).
Raistlin_Majere_D2x@reddit
What youâre describing already existed in so many other languages. Youâre saying modern Java decided to try and not suck but doing what it could to copy the efficiency of other languages. Writing Java is an arduous chore and for all that effort offers you nothing in return. It is an awful, awful  language and has been completely replaced almost everywhere you look in the last 10 years. Ya know, PHP was the way you built web services 20 years ago⊠now you would probably be laughed at.
cc007Reddit@reddit
I never said it was the greatest language, I just said it had matured a lot, by which I meant it improved quite a lot in terms of the ergonomics that you would get from a newer language like Go, Rust or Kotlin.
Also, saying it's an awful language that has been completely replaced is quite out of touch. Java is still the 2nd language (or 3rd if you don't just consider backend dev) in terms of usage and job security, according to both IEEE and Github. Furthermore, it's very fast (it tops the charts in the Billion Rows challenge), which is especially impressive considering that it is compiled to java bytecode, rather than machine code, which also makes it very cross-platform friendly.
I myself prefer Kotlin though. It can leverage all the performance and cross-platform support from the Java virtual machine, while also natively providing/supporting all the modern features like null safety, extension methods, tuples, async programming. On top of that it also can be easily compiled for android apps, iOS apps, Win/Mac/Linux desktop apps and browser apps and it supports compilation for java bytecode, native machinecode and for WASM.
BrutusCarnivalous@reddit
I get this is 15 years late... but just wanted to add that since then, Kotlin has become a truly beautiful alternative to Java. You still get all the benefits of Java as a platform, but the language itself is so much better!
It is familiar enough that any Java dev can easily jump in, with a lot less boilerplate. And then it also handles a few concepts a little better (in my opinion).
bishbosh420@reddit
I hate things being implicitly nullable and I also hate how verbose it is. I also resent that Java developers I've met seem to have this view that Java is the most natural vanilla language when really it's not natural it's just popular.
deleted_by_reddit@reddit (OP)
Programming in Java is too verbose. Too many artificial restrictions put in place by the designers of the language to keep programmers "safe" from themselves.
merzbow@reddit
Java isn't trying to be C++.
ahal89@reddit
Java's like the good ol' fashioned family station wagon. It isn't super fast, but it's really safe and for the most part gets you where you want to go in a timely manner.
C++ is like a Dodge Viper. It's really cool and super fast, but if you take a turn too sharply your car will end up flipping over the cliff and crash in a great ball of flames and your skin will start to slowly melt off your face as you try to gasp for breath amidst the smoke and charred ashes of what was once your beautiful car. Then just when you think you're almost out of the fire the gas tank explodes, sending a shock wave that knocks you to your belly, crippling you to your horrid fate as the last thing you remember is the scent of your burning hair.
As long as you're a good driver you won't have this problem.
MiroDerChort@reddit
Calling C++ a "Dodge Viper" is certainly 'a take'...
Healthy-Unit-4965@reddit
The worst thing about Java, in my opinion, is that it almost always create applications that are inaccessible using screen readers.
As far as I know, you have to do something special to make them accessible
to others
and to me
Drop it
Java is shit
wolfier@reddit
Scala does not have most of the above problems. I long for the day it completely replaces Java.
iSailent@reddit
why wouldn't java's final cut it? why do you think c++'s "const" keyword is any different?
wolfier@reddit
15 years later half of this still holds. const is different because it forces you to call const methods. to achieve the same in Java you need 2 classes - an immutable base class and setters added thru a subclass.
Thud@reddit
If you do programming as a hobby, you'll probably hate Java.
If you do programming as a JOB, you'll probably like it more. Not everybody builds enterprise-scale applications as a hobby. Java is very strong and very commonly used for back-end and middleware components for enterprise applications (Oracle Fusion, anybody?)
But as a hobby? PHP, python, etc all are much more accessible and easy to tinker with. Lots of people build electronic equipment as a hobby, but I don't know anybody that builds metropolitan power grids as a hobby.
EffectiveAsparagus89@reddit
No, I would rather work a C++ job instead of a Java job. Professional Java programmers are just delusional.
applenetic@reddit
"For every piece of important Java software, I can name 10 C++ ones with better quality"
Minecraft: ...
ItsBlazar@reddit
Notice the Important in Java software Minecraft is culturally important, but has zero worth here and java software today vs tomorrow would not change if minecraft dissapeared as there is no upstream changes
Thud@reddit
I was about to set a reminder to wait 14 years to reply, since you replied to a 14 year old comment. :-) These days, JVMâs are crap and weâre moving everything to Springboot. Java just refused to die. Thereâs still tons of âimportant Java softwareâ but in middleware and back office stuff. Itâs still a huge market for corporate stuff.
EffectiveAsparagus89@reddit
Man, 14 years is longggg. Sorry, I was just ranting. My current job is doing c/verilog instrumentation with LLVM (custom middle-end and backend passes) and slang (the fastest and most standard-conforming system verilog parser written in C++20). We develop in VSCode with clanged and ship binaries that work with riscv-gnu-toolchain and the ARM toolchain. I must say, it's the most hassle-free, productive, and delightful development experience I've ever had. The code quality, documentation, language features available, develop/debug tools are far better than whatever Java stuff I've ever used. Modern C++ is especially liberating.
ArthurArakaki@reddit
I don't hate Java though
Thud@reddit
It probably got better in the last 14 years since my original comment
yoden@reddit
For the most part, Java is fine. Boring, but fine. It doesn't have the shininess of most dynamic languages, but if you're going to be doing complicated stuff on a large team, the "excessive" verboseness of Java becomes useful. Add to this the ease of acquiring programmers, libraries, etc., and you can see why Java is so widely used.
That said, there are still a lot of obvious flaws in Java, and Java 7 isn't looking like it plans to fix many of them.
Personally, I'd use python/c for a small or mid size project and Java for something larger.
khafra@reddit
You nailed it. It's an enterprise language; a boilerplate-oriented language, which lets a larger team of more mediocre programmers create something without blowing it up. It just can't be as quick, concise, or clear as other languages.
Raistlin_Majere_D2x@reddit
I feel like everyone who is supporting Java has been living in a microcosm their whole career. âWe use Java for big stuff so it must be useful.â Itâs like saying âFacebook uses PHP so it must be good.â Except itâs not, itâs not good at all. Itâs awful to work with and itâs a complete waste of time. You canât find new engineers learning Java, itâs full stack JavaScript or Python for the most common enterprise applications, data science, machine learning, web development, mobile application development, any of the IaC frameworks, on and on and on. The only alternatives are things in the various Câs for very particular reasons typically related to optimizing for performance in gaming or low-level hardware work. No one is using Java unless theyâre just on a long-lived projects from 15 years ago or the CTO is 60 and thatâs what they used.
Java is an overly verbose mess of a language that gives you nothing in return. Itâs fast because of the JVM but the JVM isnât exclusive to Java so⊠whyâŠ
khafra@reddit
Decade and a half later, and itâs still true. Thankfully, for applications we might have begrudgingly used Java for back when I made that comment, we now have Rust!
MasteRoTroll@reddit
I am reading this in 2024 and anger briefly looking at the year I got that its 15 years old
ZeppelinJ0@reddit
Well I used to think people hated Java just because it's trendy to do so. I'm pleasantly surprised by this thread and the intelligent responses as to why people don't like Java, sorry I doubted you programmers!
deleted_by_reddit@reddit (OP)
I see quite a few trendy "I hate Java because it lets mediocre programmers work on large projects" and all that bullshit. I know quite a few brilliant programmers that work with Java. It's the tool they choose for the job.
EffectiveAsparagus89@reddit
Java tooling cannot compare to that of C++. Has anyone even programmed in C++ professionally?!
A_Firm_Sandwich@reddit
not a single person ever. c++ is not real
deleted_by_reddit@reddit (OP)
its not java that is the problem, just the frequency of java developers who think java will solve every problem. java itself is a pretty cool language, although can be a bit obtuse around the edges
like you say, when you have a hammer, everything looks like a nail.
to be fair, tho, C# .NET has become the new java and those annoying java developers are now C# developers, who have the same belief that everything can and should be written with .NET
GottaGrowBallz443@reddit
Yes. This. Thank you. .NET is every bit as terrible a Java..
crayz@reddit
From a 2 year old thread asking the same question:
Read the whole thing
14paavang@reddit
i fully agree. Its stupid. Just do it like python and every other coding language that exists out there for the sake of consistency
Dry_Somewhere3135@reddit
Just the fact that a numeric literal that exceeds Integer.MAX_VALUE must use the âLâ suffix, even if I'm storing it in a Long variable, that's just SIMPLY STUPID.
deleted_by_reddit@reddit (OP)
this will never be read, but oh well.
the whole reason behind the Java hate is because way back in the 1.4 JVM days, java was the language to use when you wanted to write BIG company applications. unfortunately, the 1.4 JVM was horrible when it came to speed. it was very common and fun just to sit back and watch your server die a slow death when 10 people connected to the app at once. most people i know stopped programming in java when .net hit the scene and if memory serves me correctly, .net was introduced around the same time the 1.5 JVM was coming around.
fast forward to today and the 1.6 JVM is amazing. it's fast as hell, very polished and extremely stable. however the language itself hasn't gotten the love it needed over the years and hence forth while even though the JVM is fast, programming in java is slow. because of this people have resorted to ported some of the more popular languages to java to abstract away the slowness of developing on top of the JVM. languages like ruby, python, scala and coldfusion all run on top of the jvm and make tapping into it's power painless.
so while most people will say they hate java, it's the language itself they're talking about and not the JVM.
sylv3r@reddit
Some people will just say they hate Java because they're too lazy to code though. Things might change with 7.
Upvoted for 1.6.
Severe-Hovercraft-86@reddit
Uh-uhhh, sorry dude.
At least I absolutely HATE Java because I've NEVER like to be taken for a ride.
Whenever I read page after page of USELESS/INCOMPREHENSIBLE/MEANINGLESS jargon, I take it for grated I'm talking with a sort of bureaucrat at his/her desk (wasting my time as well), whose ONLY goal in life is to impede/discourage people from bothering him/her with genuine questions/asking for help...........as if they DIDN'T even draw a salary for that!
Severe-Hovercraft-86@reddit
The site's full of DUMB/incapable people at their "help" department.
I've fought with many of those JERKS for months and it doesn't seem to've improved, after so long.
All they do is keep me going back and forth, finishing at the SAME dead-end (>:>= ( !
Why don't we just DUMP Java and all it stands for?
I uninstalled/re-installed it several times but still managed to keep hopes of eventually achieving anything.
To my UTTER chagrin, this hasn't happened.
Is there ANY substitute for that USELESS program (raving mad)?
therealsyumjoba@reddit
WRITING THIS TO ANYBODY
I do programming both as a Job and Hobby, and man ... JAVA gave me so many problems.
From my experience:
- Java is an ABSURD MEMORY HOG
- Java requires JVM, making installation and managament heavier (Always)
- Java projects require huge setups, wich take up memory, time and effort, while you could focus more on the actual project
- Java tends to let you easily overengineer things, every single Java program I read (even wrote!) was all of a sudden, very prone to suffer by the issues that OOP instill.
- I hear people saying that Java is more likable for a job, that's true, but if you ACTUALLY CARE ABOUT CLEAN DECENT CODE you would code a low-level backend software using C++ or something similar (The best projects I've seen are made with Rust, and that's a fact)
- Java Annotations are very messy and dangerous
- Java limits everything you might overuse, making you overuse what Java gives you
- Java is extremely verbose
- Java changes version and it always sucks to upgrade version
- Conceptually speaking, Java makes you criss cross static and dynamic things (Some classes should be static and that's it, they should be instantiated and the compiler should know this)
- Event Handling simply is a nightmare, in the majority of codebases that I've seen they have different annotations for different event subscriptions (Why these differences? Is it for Java's proclitivyt to build huge hierarchies? Seems like it ... )
- Refactoring Java code is downright impossible and always requires the redesign of the entire architecture
- IDEs for Java development aren't as flexible and are pretty huge softwares themselves (Do I have to mention how uncomfortable IntelliJ shortcuts are?)
Are you building instant-legacy systems designed to last for decades as they get more outdated and hard to mantain as time goes on? Sure, go for Java.
I would either suggest a language like Rust or to give a shot to web development. If you really want to try out a strongly OOP oriented language, but with a MUCH MUCH CLEANER CULTURE, please go at least for C#, it's like the ideal cousin that Java will never be able to reach nor understand.
In project management Java is the last option I would chose, alternatives are just easier to mantain, simpler to code, more flexible, more lightweight, more barebones, less boilerplaty, better with DevOps, better with refactoring ...
The only reason I use Java on a regular basis is because I like minecraft, so I mod it, but sometimes I fire up Visual Studio and Mod Terraria just for the sake of tasting some better C# philosphy. I escape Java whenever I can especially in the working environment.
AllowFreeSpeech@reddit
Rust is okay until the point that one has to deal with the utter horror of the borrow checker coming in the way, particularly when there are no easy workarounds. It then is an exercise in masochism.
AllowFreeSpeech@reddit
Moreover, Java is now by Oracle. Does one really want to support Oracle... it is a 10x more evil tech company than the other big tech firms.
deleted_by_reddit@reddit (OP)
Automatic Garbage Collecting and the lack of pointers manipulation as in C/C++. Once you get addicted to pointers, it's hard to quit.
AllowFreeSpeech@reddit
It's also easy to leak memory and create security nightmares with pointers.