r/java • u/Dhariann • Dec 29 '21
Why everyone hates Java?
I dont understand why java is one of the most dreaded lenguages. Java got fantastics frameworks and libraries to work with it. I dont know if im skipping something or I dont work enough with Java because I like java. What do you think??
Here is the Stack Overflow Survey
440
u/farnulfo Dec 30 '21
âThere are only two kinds of languages: the ones people complain about and the ones nobody uses.â
Bjarne Stroustrup, The C++ Programming Language
62
16
u/agentoutlier Dec 30 '21
Iâll have to google for the exact quote but there is a similar one that says unpopular languages have really good benchmarks or something like that.
The idea being the only thing you can do with the language is write benchmarking code.
2
→ More replies (9)1
u/Striking-Werewolf-32 Dec 31 '21
There are about thousand YT videos showing why Java is worse than âblahâ. The main reason is these dumb fucks can write hello world in one line in âblahâ and Java takes 3! Actual project be damned. Hello world is everything!
406
u/thomascgalvin Dec 29 '21
People like to complain. Java is everywhere, which makes it a huge target.
There are some legitimate criticisms, but as the language evolves, a lot of those are being addressed. The old "Java is slow" bullshit hasn't really been true for a decade, for example, lambdas allow you to do a lot of things without the boilerplate Java is famous for, and streams and a godsend.
But the biggest reason Java gets hate is that it forces certain conventions. People think this is stifling their programming creativity or some such nonsense. Coincidentally, the people that bitch the loudest about this are also the least likely to have successfully maintained an application developed over tens of years by hundreds of people.
When I walk into a Java project, I know more or less what I'm getting into. It probably won't be the sexiest thing I've ever worked on, but it probably won't be a total clusterfuck, either.
When I'm asked to take over a Node project, though, I feel an existential dread deep in my soul. Javascript gives you enough rope to shoot yourself in the foot, and people just can't resist pulling the trigger.
79
u/nmarshall23 Dec 30 '21
Javascript gives you enough rope to shoot yourself in the foot, and people just can't resist pulling the trigger.
That's some odd rope you found there.
I'd say that some JavaScript frameworks encourage you to use enough rope to hang an entire team with.
They're just too damn clever that in 6 months no one understands the code.
193
29
u/reqdk Dec 30 '21
Because in 6 months, the trend has moved from hanging the team with a rope to stabbing everyone in the stomach with rusty knives. And I say this as someone who uses and loves (well, lovehate) JS.
→ More replies (1)8
u/dpash Dec 30 '21
I wouldn't touch a pure JavaScript project. Typescript turns that rope into candy laces.
8
u/idealatry Dec 30 '21 edited Dec 31 '21
But the biggest reason Java gets hate is that it forces certain conventions. People think this is stifling their programming creativity or some such nonsense. Coincidentally, the people that bitch the loudest about this are also the least likely to have successfully maintained an application developed over tens of years by hundreds of people.
Have you ever used oldschool EJBâs? Boy, they really loved forcing their big boy, grown up conventions on everyone. And that convention was later acknowledged to result in an absolute clusterfuck of meaningless abstraction.
In fact people with actual souls started to realize that containment was a lot easier to deal with than inheritance in most cases, which kind of meant that Javaâs desired OOP convention encouraged a lot of bad designs with an unmaintainable level of abstracted hierarchies.
In other words, having a convention doesnât mean itâs a good convention.
But you know what? Thatâs ok. Things evolve and generally get better. And thatâs true of java as well, as weâve seen things like generics introduced (although because java envisioned such a wonderful, inescapable convention, generics are total dogshit that had to be crudely bolted onto a language where everything was an object except when it wasnât âcompared to C# or ⌠dare I say it ⌠Haskell). And weâve seen some mutated, weak-ass attempt to add âfunction programmingâ (again scoffs in Haskell). All of which is better than not adding any of these things to the language, in my opinion.
Whatâs not ok is when we are so enamored with convention that it becomes a problem. And I find the java community, on principle, is much more conservative when it comes to introducing newer features. Iâm not saying this community is a problem, but it sure as shit is annoying sometimes when you know for a fact that your language could be better but you have to wait a decade to get something C# got yesterday.
EDIT: of course the worse culprit is the need to maintain backwards compatibility, which a language like C# can ignore and add all the modern features it wants, and do it properly.
6
u/dpash Dec 30 '21
hasn't really been true for a decade
I'd say two decades. Once the hotspot JIT was introduced they performance of Java stopped being a problem.
Java does exchange memory usage for CPU performance though. Valhalla should help reduce that.
13
u/pikaynu Dec 30 '21 edited Dec 30 '21
The only gripe i had with java (older versions, 7 and below, haven't got my hands dirty with the newer releases) was the sheer amount of abstractions in their frameworks. It was hard to find a simple framework or navigate them without many years of experience. I guess that's what Go fixed. Go has very simple syntax, there aren't huge frameworks to make a project complex, imo encourages to write your own instead of importing a lib for one line of code. Rust has its own difficulties, it has way too complex syntax. It's safe but at a different cost.
And node, oh boy! It made me cry when I had to work on it. I got so frustrated that i brainwashed my team to use Go for the next one. The tooling and ecosystem were bad. We would constantly discuss on the way to implement something. We spent one full quarter of developer time to convert it to TS but that wasn't possible because only half the things were available.
Java feels a little IBMy because and that could be because big companies still have a huge chunk written in Java7 or Java8 which can't really be migrated to the newer versions.
10
u/anagrammatron Dec 30 '21
Coincidentally, the people that bitch the loudest about this are also the least likely to have successfully maintained an application developed over tens of years by hundreds of people.
Not all applications have to be maintained by hundreds of people for a decade. For many, many things Java is not the optimal solution and it's perfectly ok not to like Java. Sometimes reading Java code is like opening up a War and Peace by Tolstoy and writing it is like writing a sequel to that book. It's not everyone's cup of tea and that's ok too.
8
u/danskal Dec 30 '21
The best thing about Java is that you probably donât have to read the code cover-to-cover. You often have a stack trace to work from, and all the objects you have are type-safe and fairly easy to reason about.
Of course you can still have stringly-typed code with lots of globals and surprise nulls. But if someone who knows what theyâre doing has written it, you can pretty much rely on the IDE to tell you whatâs going on.
2
2
u/Panzer1119 Dec 30 '21
Also I donât understand the Boilerplate part. Like e.g. for many JavaScript Frameworks you have entire CLIs to generate templatesâŚ
1
u/devcexx Dec 30 '21
lambdas allow you to do a lot of things without the boilerplate
Except if you need for whatever reason to pass to a function a function that takes 3 parameters with return and may throw an exception, in which case you'll have to define an ad-hoc interface like "TriCallable" that will be end up being defined, either defined in the class where that function is, or even worse, in the feared "util" package that already holds half of your project. After that, you can use that lambda for preventing boilerplate, for sure.
→ More replies (33)1
u/ArmoredPancake Dec 30 '21
But the biggest reason Java gets hate is that it forces certain conventions. People think this is stifling their programming creativity or some such nonsense.
As Rob Pike said
Theyâre not capable of understanding a brilliant language but we want to use them to build good software.
Which also applies to Java.
Just because you're incapable of understanding something doesn't make it nonsense.
8
u/awesomeusername2w Dec 30 '21 edited Dec 30 '21
Oh common. Java is not inherently bad but in terms of language features it lacks quite a bit when copmared with new languages that were created specifically to address old problems.
Just to name a few: No null eafety, when many new languages can provide null safety guaranties by their type system.
Type system is not expressive enough again compared to new languages and some old ones. No sum types and such. There are sealed classes in java 17 but good luck funding a project that uses java 17. You can't do things like defining a method that accepts any object that can be serealized to json for example. You can just accept something, but whether or not it has sane serialization defined is not controlled by types. Or accept two object of the same type with sane equals. And it could help quite a lot, for example to forbid usage of classes without explicitly defined equals and hashCode as keys for a map.
Even a small service with spring boot and usual stuff concumes quite a bit of ram.
Checked exceptions is pain to use in lambdas and generally don't compose well. On the other hand you can't tell by method signature if a method will throw an unchecked exception.
Type erasure.
No languages support for async.
Large amount of boilerplate. Class with just 5 fields would need to have 10 methods of getters setters and overriden equals, hashCode, toString. And constructor in there to. While simple lombok's @Data annotation conveys just as much information in one line instead of fifty.
Simple things like 'import as' or type aliases.
→ More replies (3)5
u/couscous_ Dec 30 '21
You can't do things like defining a method that accepts any object that can be serealized to json for example.
Why don't
public <T: JsonSerializable> void foo(T t) { }or even
public void foo(JsonSerializable t) { }do the job?
No languages support for async.
Addressed by Loom.
Class with just 5 fields would need to have 10 methods of getters setters and overriden equals, hashCode, toString.
Addressed by records.
→ More replies (3)1
u/couscous_ Dec 30 '21 edited Dec 30 '21
Which also applies to Java.
I disagree. Java, especially in its current state, has several "brilliant language" features that golang lacks (such as generics), and that has no plans whatsoever to address (enums, sum types, pattern matching, records).
golang is stuck in the 70s and working on large golang projects is a huge mess.
→ More replies (1)
93
u/andrewharlan2 Dec 30 '21
I love Java
14
u/roberp81 Dec 30 '21
me too đĽ°
0
Dec 30 '21
[deleted]
3
3
5
u/rifain Dec 30 '21
I love Java to. People like us need to rise up. It's the perfect language in a professional environment because it has the best tools around deployment, quality check, continuous integration etc. It's fast, it's clean, it has plenty of frameworks and libraries. Multithreading, network, AI, Big Data etc, you have it all.
1
19
u/Ketroc21 Dec 30 '21 edited Dec 30 '21
There are many negative opinions about java that were once true, but no longer so. Still those opinions persist.
Java's age and backwards compatibility does make it less visually pleasing. Also, if you are very anti-OOP, then Java is likely your least favourite language.
Some people hate it without ever using it... just judging it on its perpetuated negative critiques. Like, I hate Microsoft Edge browser without ever having used it.
33
u/atpeters Dec 30 '21 edited Dec 30 '21
The four main complaints I've heard from some people are:
Generics
Null
It's not functional
Boilerplate
These are people that want to work with closure, erlang, Haskell, etc instead.
Personally I don't mind Java much except for working with JSON due to generics and cast checking. Admittedly I'm stuck in JDK 8 and I don't know if that has been improved upon.
3
u/minato3421 Dec 31 '21
Working with Json in Java is a pain in the ass. I recently had to write a Go service in my current organization and was surprised to see how easy it was to handle Json data in Golang.
3
u/ConstructedNewt Dec 30 '21 edited Dec 30 '21
Records take away so much boilerplate. Sadly classes are still expected to be 1 class per file, so you har some one-line files (or nest them)
Null is a real problem, but, like generics (and pain points on them), it's mostly the designers fault. All though language can promote bad/ good habits
3 is just stupid to complain about. Like, sure... use something else idc
Jackson JSON ObjectMapper to a record type is pretty simple, but hasn't changed much (since java 8) although I'm unsure about Snake case names
Edit:
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)4
u/Muoniurn Dec 30 '21
Sadly classes are still expected to be 1 class per file,
Thatâs only public classes. You can put non-public records outside your public class.
→ More replies (2)3
u/deinlandel Dec 30 '21
You can just use Kotlin and fix all of these while maintaining full compatibility with an existing codebase and all JVM libraries and frameworks.
That's actually what is great about Java Ecosystem: you are not limited by one language.
1
u/atpeters Dec 30 '21
The problem though isn't with the JVM, just the Java language. For example, they like Clojure and Scala. Personally I don't like lisp syntax. I find it harder to read.
1
1
u/fletku_mato Dec 30 '21
Personally I don't mind Java much except for working with JSON due to generics and cast checking.
This should not be an issue if you pick the right tool for the job. ObjectMapper let's you do all kinds of wonderful things (and also horrifying if you wish) when deserializing.
Just, don't ever think it's a good idea to start manually parsing the json instead of writing a proper class for it.
→ More replies (1)1
u/Ineffective-Cellist8 Dec 30 '21
What's wrong with (java's) generics? I don't use java but C# generics are nice and I hate C++ templates
→ More replies (39)1
u/kuzux Dec 31 '21
Generics
Is the complaint about Java that it has generics? Type erasure (or some other detail about the generics implementation)? The fact that pre-generics Java code exists?
31
u/CubicleHermit Dec 30 '21
Well written Java in a good framework is actually my favorite mainstream language.
There's a lot of bad Java out there, and while most Java frameworks when new have been pretty good for their time, plenty of them have aged badly. It's the COBOL of our day - my day to day work, for example, involves some code that is likely older than some of the interns we will get this summer (started in 2001.)
Lastly, there are a few corners of the Java ecosystem that really need to be just plain retired.
1
u/jumurtka Mar 02 '22
Well written Java in a good framework is actually my favorite mainstream language.
What do you consider as a good framework?
2
u/CubicleHermit Mar 04 '22
Depends on for what; for modern BE services, my go-to is Micronaut these days. I haven't used Quarkus or Helidon.
Spring/Spring Boot is potentially a good framework but easy to abuse - it has a higher barrier to "well written."
Grails was good for its time for older style apps that still had MVC in the Java layer and weren't purely serving an API.
Any framework requiring a J2EE container and not just a light servlet container like Tomcat is almost certainly not a good framework. I've only had to work with those through code from acquisitions, and... ugh. Not quite the same, but... OSGi.
There's a lot of other old stuff that wasn't that bad for its time but it shudder worthy if you hit legacy code - Struts, or Axis, for two I had to work with a lot back in the day.
29
u/Qildain Dec 30 '21
I enjoy working with Java. I wasn't even aware of the SO survey, so I would be hesitant to trust the sample striation.
The way Java is going (Loom, Valhalla, etc.) gives me a lot of good feels about it.
63
Dec 30 '21
Only bootcamp programmers hate
17
14
u/looneysquash Dec 30 '21
Maybe this subreddit and some other language subreddit should get together and swap this question.
Everyone here actually likes Java, or else is afraid to comment for fear of being buried in downvotes.
16
u/bilingual-german Dec 30 '21
I don't like java, but I don't want to get downvoted.
In my experience, people who like Java never had much exposure to other languages and seem to also not have that much operations experience.
There are a lot of good things in Java, but too many bad ones. People writing over complicated unreadable and unreliable code are one of them.
Error handling with Exceptions has so many issues...
When I discovered other languages, Java didn't have Closures. You needed to write a single-method interface and implement it. Did you ever take a look in the original Gang Of Four Design Patterns book? Did you count how many of these patterns implement only one method? This was something I liked in other languages and it's good it came to Java.
A lot of Java is just "we did this this way for the last 20 years, we'll continue it!". Yes, I'm looking at you getters and setters. Oh, fuck Lombok. This doesn't solve it, it just introduces more problems.
Fuck maven.
ok, bring the downvotes.
→ More replies (2)3
u/Prateeeek Dec 30 '21
I'm sorry I'm a junior, I'd genuinely like to know the reasons of dislike for maven and Lombok.
3
u/looneysquash Dec 30 '21
IMO Lombok is great. But also, they need to integrate it as part of the language. That they haven't done that yet, and that you need ide plug-ins, isn't great.
Not sure what that guy didn't like about maven. It's an ok-ish dep manager. Way better than the "no package manager" approach we used before it.
→ More replies (5)3
u/bilingual-german Dec 30 '21
Package managers are good. Maven is shit. Especially the error messages. You need to enable debug mode with
-Xto understand what the problem is. Starting a full JVM for a short living process makes maven slow when you compare it to other package managers. I'm also very sceptical about the security of their plugin approach.I like that it hasn't the one-repository-to-rule-them-all approach of npm, but if Maven-Central is down, you probably still can't build your jar.
My issue with Lombok is, that this is magic. It's code you can't see. As long as it works, it's ok, but as soon as Lombok has a bug, you're screwed. You'll never find the issue.
→ More replies (4)7
u/ArmoredPancake Dec 30 '21
The thread is just a circlejerk. If you wanted to know real opinion about Java you'd have to travel to subs of other programming languages.
13
12
115
u/chrisgseaton Dec 29 '21
Anyone who tells you they have a hatred for a programming language isn't worth listening to.
15
u/CubicleHermit Dec 29 '21
Anyone who tells you they have a hatred for a programming language isn't worth listening to.
Hating the language vs. hating to have to work with it are two different things, but for a relatively mainstream language, either one is probably overstating it.
OTOH, I work with someone who used to work with M (aka MUMPS) and I fully believe them that it was awful.
There are bad codebases in every language. I've really enjoyed both C# and much longer ago, VB6, both for personal projects. The experiences working with each for "real work" was horrible, but that was pretty much all a matter of the codebase and the tooling around it NOT the language itself.
56
u/Fair_Sir_7126 Dec 29 '21
I upvoted, but please put JavaScript on the exception list
16
31
u/Neuromante Dec 30 '21
We can just say Javascript is not a programming language but a hellish dialect escaped from the depths of hell as part of a punishment to humanity, if you like.
14
u/manzanita2 Dec 30 '21
The original javascript was created in 10 days. Given that it turned out pretty ok. But yes, there are a ton of crappy things that one would have fixed after some road time. But backwards compatible is king.
5
u/Ilookouttrainwindow Dec 30 '21
There are things in js that are really neat. But to me it suffers from that "just a script" feel. Typescript helps, but still has same feel to it. I've been working on java since 1.2; got a good feel for it. Language is evolving, approaches are changing. Some things I like some things I hate. Been working with js just as long, although always in the browser. Latest trend with js is syntax simplification to the max. The language is honestly becoming hard to read. With Java, if you have basic idea (even of another language) you can read the code and probably even make sensible changes. With js, I begin to need to look up the syntax to understand what is written (same in c#). Last time I had to do that was with perl. Personally
9
3
→ More replies (4)3
5
u/buzzsawddog Dec 30 '21
I hate JavaScript, ruby, Perl, pascal :). Languages I deal with on a regular basis :). But mostly I guess I hate maintaining the code people left with me with to maintainâŚ
0
Dec 30 '21
[deleted]
2
u/spectrumero Dec 30 '21
It was widely used professionally in the 80s and 90s. Delphi still exists, I think. Windows 3.x used the Pascal calling convention (so any C program you saw for Windows 3.x was littered with FAR PASCAL macros).
→ More replies (1)2
1
→ More replies (18)1
9
u/ratel26 Dec 30 '21
It's not just Java, all existing programming languages are awful. The very concept and how we perform "software engineering" is flawed. That's why someone invents a new programming language every other week, with claims that it's going to solve all the problems, only for it to end up having the same problems as all of the other languages.
I think if most people knew how computers worked and how software is developed, they'd want nothing to do with them. It's a miracle we've gotten as far as we have.
I don't know what the solution will be. If Turing is our Newton, we're still waiting for our equivalent of Einstein to come along. I'm hoping that in the future what we think of as computers and how we interact with them will be fundamentally different, although I probably won't be alive to see it.
9
u/greglturnquist Dec 30 '21
Everything is a trade off.
Java is solid and stable. It started with a lot more âbatteries includedâ then C/C++ ever did and simplified by making ALL method virtual and avoided pointer nightmares.
C/C++ put you about we close to the bare metal as you could get while still retaining being a high level language. But this required managing memory yourself. And ultimately proved to only be needed for certain situations.
Python is what TCL wanted to be: a nifty scripting language that really could bind with complex libraries. Itâs simplicity is traded against performance issues and lack of multithread support.
Go was the response to C++âs death spiral. And it provides a lot of cool stuff. But even itâs gutsy moves are showing a little age as people contemplate alternate features in stuff like Rust, Kotlin, or Swift.
Rust is a godsend for those writing C code because it offers a life saver when you need bare metal code that doesnât drag you into the 9th circle.
Ruby on Rails was the power house of e-commerce entrepreneurs. What other tool at the time let you win angel investor and seed money with just ONE coder? Of course after you got your funding, THAT was the time to rewrite it into something more sustainable.
JavaScript is where itâs at because who else has such ubiquity in the browser? While NodeJS makes many cringe, it offers a way to give people a step up in take home pay with a mere 12-week Boot Camp. Seriously, MANY people have had life altering career changes by learning JS and getting hired in less than a year.
I love the competition these all bring to the table.
2
u/wildjokers Dec 30 '21
TCL wanted to be
tcl [wanted {{to be]]} [$a] {total {{[[piece {$of} ] $unreadable ]}} shit] {{$just} shoot ] {me} now]} [{{it's the} [{only explanation}]
2
u/DasBrain Dec 30 '21
Please balance your braces.
{}: Literal[]: Command substitution$: Variable interpolationPerl is much worse with special characters.
→ More replies (2)
52
u/PositiveUse Dec 29 '21
I think itâs people who never used it professionally and just got burned by JAVA during their time in university where they love to use JAVA for dreaded courses like programming and algorithms/data structures.
So many web applications use a JAVA/Spring Boot/EE backend, itâs just not reasonable to hate the language as itâs pretty awesome to work with professionally.
12
u/thephotoman Dec 30 '21
The problem is really a problem of Java not being all that friendly to use for standard and file I/O. Java can do it, but it's expecting you to need to be safe--not merely slapping something together to demonstrate a concept.
That's why I hated Java in college. It wasn't until I got into the industry why I realized it was popular. In college, I was using the wrong tool for the job. Now, I'm in an environment where the tool fits the job nicely, and my gripes were relatively minor now that I fully understood the use case (but type erasure still sucks--I'd love better generic programming, and yes, I know about Valhalla, which isn't really about getting away from type erasure entirely but rather represents a significant step towards that, and I'm excited about it but not as much as I am about Loom).
9
u/dpash Dec 30 '21
java.iois bad, butjava.nio.filesis very easy to use. Sadly no one bothers to learn the new API, even though we've had it for 15 years.2
Jan 20 '22
I use it professionally with a java 8/websphere backend and I hate it. Java 17 seems nice, but I will never use it professionally (at least in my company).
15
u/magnoliophytina Dec 30 '21
Modern Java is pretty decent (that is, Java 17). Most libraries still assume non-modular Java and use lots of mutable state and excessive number of wrappers, GoF design patterns, and over-complicated object design overall. Many helper methods like List.of were also absent in earlier versions. Same problem with high productivity classes like the Executors.
Many tools also suffer from slow start-up time due to the way the VM works (background daemons & nailgun style designs help here). I think if Java had had reifed generics and project Valhalla & Loom style improvements right from the start, there would be more motivation to strive for effective bloat-free code.
Another source of pain is the huge amount of legacy code. It's quite common to find hundreds or thousands of legacy code conventions even in small Java projects. For instance, using public static final int CONSTANTS instead of enums. Modern IDEs could fix these, but the maintainers of such projects would not accept pull requests because they might want to maintain compatibility with Java 1.4, 5, or 7. Heck, they might not even use git (sourceforge still supports svn) so that's a great excuse for not accepting PRs.
7
u/ancientweasel Dec 30 '21
Java is a widely used language and as such has a lot of bad projects along with the good ones. Java also takes a long time to start up, especially in DI frameworks and Enterprise servers. This is an actual impediment in high scalability architecture.
Also, a lot of people hate Java Bean Programming and not necessarily Java. I showed a coworker who hates Java some code I wrote in Java in a clean Go like code style. He admitted after that that it wasn't Java that he disliked but Java Bean Programming.
1
10
u/fix_dis Dec 30 '21
Java is just a language. One can hate aspects of it, but that typically comes down to preference⌠and thatâs easy to brush off.
Where legitimate hate comes in, is in how people have written âenterprise Javaâ over the years. This massive bloated 5 files full of providers and factories when a simple if-statement would have sufficed⌠That is very hateable. But I canât blame the language for that.
5
u/anagrammatron Dec 30 '21 edited Dec 30 '21
This massive bloated 5 files full of providers and factories when a simple if-statement would have sufficed⌠That is very hateable
I was one day just looking at Spring Boot Pet Clinic example which is often recommended as a reference point to starting a simple project.
Pet extends NamedEntity which extends BaseEntity which extends Serializable
Owner extends Person which extends BaseEntity which extends Serializable
where BaseEntity is basically just getting and setting Id and they just keep extending it in layers. I get the intention, but If I was a newcomer from another language looking to get into Java/Spring then I'd just roll my eyes.
2
u/fix_dis Dec 30 '21
I wrote Pascal, C, Visual Basic and some Lisp before I ever touched Java. I picked up a book to help me learn for a project I was going to be helping with at work (this was 2002). The Java in that book looked completely fine. The stuff I saw on my screen was a twisted mesh of âIâm really smartâ. And Iâve seen that everywhere Iâve worked since. Iâm all for abstraction once the interface has truly revealed itself. But STARTING with that? No thank you.
5
u/Qildain Dec 30 '21
More elegant? There are alternatives like Quarkus and Micronaut. And who says everything needs to be RESTful?
5
u/slothordepressed Dec 30 '21
As someone who used to work with JS and moved to Java I can say that it's verbose and have tons layers.
As many said, the only language that is not hated are the ones that are not used
5
u/khooke Dec 30 '21
I love reading through the StackOverflow developer survey each year but the thing to remember, as with any survey, it's heavily skewed to the point of view of developers that are inclined to spend time to complete this type of survey. It's not representative of the entire industry, it's the point of view of a very narrow population of developers.
Does everyone hate Java? No, of course not. For many developers it's their bread and butter. I've been developing with Java for 24 years of my 28 years as a professional developer. I owe a significant part of my career to the language, the platform and the community. It's helped pay my bills for 24 years. Why would I hate what has contributed significantly to a successful and highly enjoyable career?
5
u/Affectionate-Box-837 Dec 30 '21
I think most programmers makes the decision of liking a language based on their experience working with the language. For example; working with legacy code sucks, Java is one of the old languages that stood the test of time. Therefore, someone is more likely to associate using java with legacy code and using a newer language with a new project. Therefore programmers hate java instead of hating the circumstances like working with legacy code.
The main problem I have with java is nothing gets depricated, which means language carries a lot legacy.
5
u/post_depression Dec 30 '21
One funny thing I noticed in this context, personally every people Iâve met who hates Java really doesnât know much about the language other than âSyTeM.oUt.PrInTlN();â is such a drag to print to console or something similar.
Java is like the Apple of programming world. Most people who hate it does it for the âtrendâ and not with any legit reason.
I believe Java and C# (and C++ to some extent) are the only programming languages that have managed to adapt over the years as the programming landscape has changed when other languages got obsolete.
21
u/thisisjustascreename Dec 29 '21
Most objections to Java aside from the base language syntax are out of date. It is admittedly fairly verbose relative to some other languages, and Spring (not Spring Boot) has a reputation for being obtuse and heavily reliant on XML which is the worst possible configuration format for human readability.
The JVM is a modern wonder of the world, you can tell because people keep writing new languages that compile to Java bytecode.
25
u/Qildain Dec 30 '21
XML which is the worst possible configuration format for human readability.
I haven't configured Spring with XML in over a decade.
10
5
u/thephotoman Dec 30 '21
I wish I were young enough to have missed that era entirely. Nope. I got one year of it before annotations came and made all our dreams come true.
Yeah, you talk about annotation hell. I understand. We need a better solution. But it is still a substantial improvement on that. I'd like the next solution to be that much better. Even if that's some extension to the language itself to allow for more and better metaprogramming so that inversion of control wasn't a framework thing but rather something you could merely enable by using a specialized class declaration. I'm trying to think through what that means, but I'm too drunk for that right now, and it's late.
→ More replies (7)4
u/__pulse0ne Dec 30 '21
I would put money on at least 90% of search results regarding spring configuration including some sort of xml
3
u/nunchyabeeswax Dec 30 '21
Well, if you are googling for examples, you are going to get... wait for it... basic examples that will inevitably show some XML configuration for completeness.
Not only that, you will inevitably run into undated examples that have been written for Spring 2.0 (which didn't have annotations over a decade ago) or 3.0 (which introduced annotations in 2009.)
Now, instead of putting some money into something anachronistic, just do a google search for "how to configure Spring without XML".
See, web searches are GIGO : garbage in, garbage out. If you search for garbage, well...
Like the two OPs before you, I've barely used any XML for configuring a Spring/Spring Boot system in real life, in a commercial (read, non-homework) setting.
Verbose XML configuration hasn't been a legitimate complaint against Spring for over a decade (or against JEE for almost two decades.)
6
u/nunchyabeeswax Dec 30 '21
Spring (not Spring Boot) has a reputation for being obtuse and heavily reliant on XML which is the worst possible configuration format for human readability.
That argument is also obsolete.
I haven't seen a Spring/Spring boot app heavily relying on XML configuration. Heck, we can literally avoid XML completely in most cases by simply using annotations and default settings (which are typically fine.)
Complaining about Spring (and Spring Boot for that matter) because "XML" is like complaining about Jakarta EE because of EJB 2.x (which pretty much became legacy/dead
since 2004.)3
u/thisisjustascreename Dec 30 '21
Yes, it's obsolete, but that doesn't stop the reputation, and it doesn't stop legacy apps still using it, sadly.
→ More replies (1)0
4
4
u/ibutbul Dec 30 '21
Something I learned along the way, people are hardwired into football fan mentality, they like to feel "superior" by belonging to a team (at least the vocal ones make it seem that way).
At the end most languages that serve the same purpose tend to add features that make their differences less apparent over time, hating on a language is stupid in my opinion, they're tools, like hating on a chainsaw or a screwdriver...
Usually these people don't know how to explain their hatred and it boils down to "Haha System.out.println is so long to type, lol" or some other joke.
Bonus triggering code to Python haters:
a = a[0][0] = a[a[0]==a] = [[0]]
a = a[0] = [0]
In python:
1 -> fails due to maximum recursion depth
2 -> works! but might give nightmares
In Java:
The compiler won't even let you run these.
P.S I wanted to add a C/C++ trigger but they're too chad to pick a fight with, if you see any asm x86 dev, run away.
4
4
u/exact-approximate Dec 30 '21
In my experience, the only people who enjoy hating Java are those who are bad at Java.
And actually, most of the hate is misdirected - most times people would want to complain about the framework they are working in - Java Beans, Spring, Spring Boot, Tomcat, Big Data Framework etc. - not the actual language.
I now firmly sit in the python world (not by choice, just adapting to change). But I don't spend any time ripping on Java. Sometimes, I miss it.
4
u/quadrat137 Dec 30 '21
I'm a Java developer with 10+ years of experience, and I wanted to give a bit of my criticisms on the Java
â¨Please forgive me for spelling, as English is not my native language â¨
â¨My perspective might be different from most of comments here though as a lot of people are comparing it with C - I think any language that has GC can't be directly compared to the one that don't because not having GC pauses is a huge deal and can't be traded off in some scenarios(e.g OS, drivers, games)
So, the points compared to other GC languages, typed and untyped:
â¨- verbosity of the language itself(much have been said here, it's getting better though - records and multiline strings for example. Still string interpolation when) â¨
verbosity of most of the current approaches - compare how do you do HTTP request with python or go with how you do it in Java(I'm talking about new HttpClient, URLConnection is thankfully not used by anyone) â¨
a mess that standard library have become with years(Date? Or Calendar? Or Instant? Why Instant vs LocalDateTime? What is the difference between sql.Date and util.Date and etc) â¨
a mess that is the IO system(In 10 years I still haven't learned how to read a File in java and have to google it every time) â¨
Non-reified generics, aka type erasure (it doesn't affect me personally, but with them libraries wouldn't have to rely so much on reflection and offer nicer APIs) (project Valhalla when?!) â¨
Null-safety and ugly ways to deal with it in general â¨
Over-reliance on exceptions(very often the code just rethrows an exception instead of error handling, which quite often makes code hard to understand, test, and also has a big performance impact) â¨
There are two ways to write parallel code - Threads(which are heavyweight) and callback hell(which has it's name for a reason) (project Loom when?!)
â¨- Default GC has somewhat long pauses that are not good - but thanks everyone for ZGC and Shenandoah. Still, that thing not being default quite often makes Java servers to be perceived as slow, as max latency is more important than throughput in most business scenarios
â¨â¨A lot of those criticisms are addressed in other JVM languages, with Kotlin being my current favourite â¨
⨠Also a bit on the go-to approach, which is Spring framework â¨
It's quite slow - both in terms of throughput and latency - which brings it's performance to be on par with dynamically-typed language platforms like Python or Node â¨
It's very "convention over configuration" with a ton of reflection inside which makes it really hard to understand what is not working and why â¨
It's configuration is easy to mess up, which will lead to hard-to-track production bugs or easy-to-notice complete outages â¨
It's, IMO, very immature for such important technology - I encountered couple of critical bugs in the framework itself ⨠â¨
That being said, Java is not a bad language - but so are competitors.
In general - if you are stuck with JVM, you can go for Scala or Kotlin, both having better approach to the concurrency and less opinionated frameworks
If you need to build something fast, you can use Python or Node, both being great for scripting and creating MVPs
If you need something to work fast, you can go for Go, with pause-optimised GC and green threads
â¨So there is not much point in using Java for a new project currently except if you already have a team that would prefer Java, and I believe it's the reason of its decline(according to TIOBE at least).
But don't be discouraged you fellow dinosaurs - COBOL is still alive and kicking, so we will always make good money maintaining that 20-yo Java monolith serving trillions of dollars in volume every day
2
u/DasBrain Dec 30 '21
In 10 years I still haven't learned how to read a File in java and have to google it every time
9
u/PatriotuNo1 Dec 30 '21
Every major project which is enterprise level and is web services based would most likely use Java. Half projects on freelancing platforms demand Java. Spring Boot and JPA are the best things that happened so far for this technology. Spring Boot is scalable and its testing is easier.
Some complain because you can't manually use pointers like in C and they are bold enough to not let this handled automatically. Or because is object oriented and not functional. So most of these people write low level code and don't know this language's full potential otherwise they wouldn't complain.
13
u/Hamenaglar Dec 29 '21
Java is OO language, but most frameworks and project architectures are designed around stateless services and behaviourless models.
Such style was actually considered anti-pattern. Anemic domain model.
I guess the reason is, the java world just moved in that direction, simpler models, where most of the logic is simply storing data to DB. Rich domain models simply provide little or no benefit.
Other languages, frameworks and platforms just do REST easier and more elegant.
From my reading of this sub, a lot of people don't like OO (not everything is an object). Perhaps, rightly so. And Java is like this mix of OO, backwards compatibility and trying to catch up with new trend too slowly.
And finally Java is widely used, one of most widespread languages and often developers are forced to work on it by their companies. More popular languages, I assume, are used by minority developers that WANT to use them.
Just my 2 cents. Oh and I'm a professional Java developer for 10 years.
6
Dec 30 '21
Rich domain models simply provide little or no benefit.
I worked on a big enterprise code base for 6 years and it took me a while to realize that I didn't actually "know" OO, precisely because the code base had been architected around data mapping, rules engines, etc. Writing "functions" as named components managed by something like Spring is a little clunky, but really isn't that bad.
It's really true that IDEs are what makes the entire Java ecosystem make sense. I'm still way more productive editing Java in Intellij even than something like Clojure because the semantic refactoring provided by the Java/IDE integration is just so so good.
3
u/Qildain Dec 30 '21
See: Valhalla.
Java has evolved nicely (sometimes less-so) over the years, and if you don't keep up with it, it will suck to work with.
8
u/magnoliophytina Dec 29 '21
Other languages, frameworks and platforms just do REST easier and more elegant.
If by elegance you mean the lack of type specifications. Many popular languages don't strictly require any specification of types or effects. This means there are less guarantees of the correct operation, less documentation, and more undefined/unexpected behavior. But I guess that's ok for rapid prototyping.
4
u/Qildain Dec 30 '21
Honestly, it all depends on the framework. "just do REST easier and more elegant[ly]" says "I only use Spring Boot" to me.
→ More replies (2)
6
u/ir210 Dec 30 '21
As someone who used to hate Java, I can tell you the reasons why I hated it.
The language was boring
(not really the language) Java programmers tend to over complicate things under the disguise of âenterpriseâ solution. Hence boilerplates everywhere. Most likely due to the âsimplicityâ of the language.
But with a lot thatâs going on nowadays, I am beginning to like Java. Heck now I am committed to it.
In my opinion the mentality has shifted as well. Now Java programmers value simple and straightforward solution than complicated, âenterpriseâ one.
Man, I used to hate the word âenterpriseâ too.
3
u/FilsdeJESUS Dec 30 '21
I like Java because it is strict I the conventions and strongly typed . Those who do not like it , I really does not understand
3
Dec 30 '21
Because is huge, like C, C++ and PHP. The most hated programming languages happen also to be the most powerful, if you think about it.
3
3
u/qK0FT3 Dec 30 '21
In university no one was touching java because it was boring for them for some reason I still don't understand. I have read some articles about java and it's ecosystem and I thought I can use it for my final project. And it was so easy with spring boot. That I learned DDD(just the tip of it) in 3 months and I built a whole team task management application like trello. I even learned how to use it in docker, vuejs for frontend etc and boy it was just easy with couple of files. I don't know why people hate it but I made 4 student job in 3 months. Because I was able to produce maintainable code and easily readable. That was so easy to change and add new things.
I think most people are bored/scared of it because of old frameworks and old java api or java bein booed all over the university, conferences etc. . New frameworks and new java api helps a lot. I mean I feel cleanliness.
Since university I have been making a living from java. On a startup company. And boy when we get a new intern etc they can get into the code in day 2-3 easily. I don't know if that is the case for other programming languages. I worked/working with php, js, ts for some time and even new coming non-intern(senior/mid/junior) developers takes at least 1 week to go in and make reasonable changes. And we/I tried to make a really clean code. They just feel and is scripting languages sadly. But they have use cases which is better than java. For example php is very good for generating tools for front page and js/ts is good for basically frontend of our api.
Every language has something that excel in. Every language has their downs and ups. No need to dramatize.
2
u/mj_flowerpower Dec 30 '21
I know some people who are overwhelmed with frameworks like spring. They think that java = huge junk of 20 years old legacy frameworks. And that may be true if you get a job where you maintain an old codebase.
Often these are still on java 8!
What people coming from languages like c# or typescript are missing is mostly the async/await stuff. Which makes it so much easier to write scalable code that looks almost like traditional sequential code.
It's not without issues, but it's way better that something like rxjava.
What I personally love about java, is that when using java with maven everything is already laid out for you: folder structure, file naming, dependency management, build lifecycle, code formatting (if you are using an IDE, which you should do! :-))
In javascript/typescript this is all so messy and tucked together. It's rocket science to get that all configured. And it's soo fragile. Dependencies are coming and going by the week it feels, often without any upgrade/migration path.
Java and its ecosystem is so stable, it's just pleasant to use.
I only wished they'd finally implement the null-safe-operator ?, async/await (kindof coming with loom) and template string (somewhat coming too, but in a very weird way).
1
u/qK0FT3 Dec 30 '21 edited Dec 30 '21
Isn't Elvis operator is?
?:or We can useOptional?But while saying this I agree with you in general. While java SE api is mostly good there is still problems you mentioned. I think they are changing language in a very good way lately. Changes with java 17 was amazing. And I saw changes in java 18 they are better. When I see people writing code like that I am amazed that they are so intelligent. just amazing engineering when I look at it.
just found this article about nullsafe operators. look at the comments :)
→ More replies (3)
3
u/tim125 Dec 30 '21 edited Dec 30 '21
I suspect these are my gripes. I love java.
Eclipse & Netbean are painful. If its harder for a new software developer to compile and debug in 2022 than it was in 2000 with Turbo Pascal and VB6.
JPA lazy collections exceptions with no session.
XML parsing mechanism changed too many times.
Webservices were inconsistent. Soap binding generation was painful with library hell.
Original documentation was not as good as PHP/Microsoft equivalent. PHP had an amazing documentation system where every function could have Q&A built right into the documentation system so you did not have to trawl stack overflow/equivalent for the most common questions.
The only point on this list that is specifically java is #1. The rest are community/environmental issues.
3
u/vytah Dec 30 '21
I'm surprised no one mentioned applets and the pain in the ass they were from both the user perspective and the security perspective.
The applets are gone, but the damage to the reputation they've done is not going away any time soon.
3
u/WafflesAreDangerous Dec 30 '21 edited Dec 30 '21
Why some people don't like it, or have a negative impression: Some simple things are slightly convoluted, there was that xml and SOAP maddness, and its popular with the enterprise which tends to lag behind in adopting all the nice upgrades and has a lot of legacy code.
Also, java in the browser sounded promising (and had success stories like RuneScape) but was a failure long term and kept "java" security issues in the news constantly.
The language itself if pretty decent and a lot of work is going into fixing the issues it does have. Modern java can be a lot less verbose than the equivalent code from 5 or 10 years ago.
3
u/Yesterdave_ Dec 30 '21
Simple answer: EVERY programming is actually sh*t. If you think your favorite language is not, you are just a junior that hasn't worked enough with said language to discovered the ugly or you are just implementing some trivial CRUD apps.
3
u/meamZ Dec 30 '21 edited Dec 30 '21
Java got fantastics frameworks and libraries to work with it
Well maybe unpopular opinion here (and i like Java) but while there is a library for just about everything the feature overload and bloat is just huge with a lot of them. Log4J beeing a prime example... Log4J 2 doesn't really do just one thing. It has a gazillion features that basically noone ever uses which leads to a bigger ressource use and increases the probablility for severe vulnerabilities.
And i think a lot of people hate it because it's quite verbose (a bit too verbose imo) for smallish Projects and its strengths really only come to play in big codebases with complex domains.
And another thing is probably that a lot of people hate the kind of code that a lot of people using it are writing with it (or at least used to) which probably has more to do with the fact it's used in enterprise contexts a lot. It's this design pattern overloaded YAGNI style that makes everything overly complex (instead of KISS) for the sake of loose coupling over everything else.
4
u/wildjokers Dec 30 '21
Log4J 2 doesn't really do just one thing. It has a gazillion features that basically noone ever uses which leads to a bigger ressource use and increases the probablility for severe vulnerabilities.
I was really surprised Log4j 2 is used as much as it is. I just thought everyone migrated from Log4j 1 to Logback.
2
9
u/Admirable-Avocado888 Dec 29 '21
It seems to me that Java gets a bad rep mostly because it chooses to be binary backwards compatible. This leads to some features that don't age well as the language evolves. Also, java gets much criticism for the need of boilerplate.
My experience is that features that age badly are only problematic if I don't follow new idioms. The boilerplate is also mostly a non-problem so long as I use new language features.
2
u/atpeters Dec 30 '21
Can someone please comment on why this is being down voted?
→ More replies (1)
5
4
2
2
2
Dec 30 '21
Coming from Javascript/NodeJs, Go and PHP. I can say every group thinks they are being hated and partly true but most of the time itâs envy.
Java is a great platform its not just a language, specially how well it adapted to modern needs and competed with nodejs and go in terms of small footprint and ease of use.
2
u/sweetno Dec 30 '21
That is a bad survey. There should've been an option "I don't know about this one" or "neutral".
I don't know what wording they used for this question, but not loving something does not equate with hating it.
2
u/lukaseder Dec 30 '21
"There are only two kinds of languages: the ones people complain about and the ones nobody uses" -- Bjarne Stroustrup
2
u/Less-Tour-1082 Dec 30 '21
I love Java. But complexities with Spring Framework and Hibernate (Optimisation, Threading and Dirty Checking) really gave me grey hairs. Once everything is working itâs plain sailing. Java over JS/TS any day of the week for me.
2
u/Talked10101 Dec 30 '21
I don't enjoy working with Java, but I have done professionally and can see it can be used to build robust high scale systems. I also struggle to see why you would pick Java over Kotlin for instance in a completely greenfield project.
I just have never personally gelled with the language and have never used it outside of a professional environment.
2
u/quizteamaquilera Dec 30 '21
I love developing on the JVM, but I hate Java as a language. It has gotten better, but still have fundamentally problems, like itâs mutable-by-default collections library, and culture of annotation-based app development.
I just prefer functional programming, as Iâm not smart enough to reason about all the magical wiring and mutable state found in a lot of the Java code bases Iâve seen.
For the curious, Iâd really recommend âwhatâs functional programming all aboutâ:
https://www.lihaoyi.com/post/WhatsFunctionalProgrammingAllAbout.html
1
u/wildjokers Dec 30 '21
like itâs mutable-by-default collections library,
I am unsure why collection mutability is always brought up. Why have a collection if you don't want to change its contents? Why should I have jump through hoops to add something to a collection?
I have had to fix many bugs caused by someone using the newer immutable collections and then someone else trying to add to it. It is annoying as shit. If I want a collection I want to be able to add and remove items by default. Please stop the immutable collection nonsense.
→ More replies (1)
2
u/henk53 Dec 30 '21
Often people think they need to hate, and the hate is based on the hype surrounding them and what they just happen to use.
For instance, XBOX owners often feel the need to hate Playstation. But is a Playstation really so much worse than an XBOX? Or is it quite similar, and perhaps even better?
Android users too often feel peer pressure to hate on iPhone, but again, is the iPhone really something to hate? If their peers happen to have an iPhone, and so they would have an iPhone too, would they hate using it, or would they feel the need to hate on Android instead?
With programming languages it's often not that much different. Sure, there are certain languages that have (or had) a certain community with certain values. One could argue that the early PHP community was a different kind of that from say the Scala one.
But otherwise, there's little to explicitly hate, and most hate is imagined, peer pressured and psychological.
2
u/sohang-3112 Dec 30 '21
Java the Platform, i.e., the JVM (Java Virtual Machine), is good - it's fast because it has had lots of optimizations applied to it. That's also why many languages are built on top of the JVM. And of course, as you mentioned, there are a huge number of libraries available in the Java ecosystem.
However, Java the Language sucks - it just has a huge culture of verbosity. What can be done in one line in Python can take at least 4-5 lines of code in Java. Also, Java forces its version of OOP down your throat all the time - you have to create classes upon classes when all you wanted was a simple function! Yes, OOP is useful for some things (eg. GUI Programming) - but definitely not everything.
2
2
u/SpeedDart1 Dec 30 '21
Because itâs boring and reliable, people prefer innovative and novel. But those less interesting qualities about Java are precisely what make it a good business language.
Also I think people hate it merely because it is trendy to hate, just like they do with JS.
2
u/SpeedDart1 Dec 30 '21
Personally I donât like working with it as much as say nodejs but it in terms of actually getting the job done itâs a great language and I wouldnât pick anything else.
Reliable, fast, and easy to maintain. What else could I want?
2
u/franzwong Dec 31 '21
I think most of the hate are coming from J2EE era. The OO hierarchy was quite crazy. Application server also added some complexity. After Spring took over, POJO and embedded app server are more preferred and things become simpler.
3
3
u/Keeps_Trying Dec 30 '21
2 things turn me off with java
"Experienced Corporate Devs" that have made an unholy mess of anemic abstractions over libraries in code that runs the business
"Newer Devs" bootstrapping new systems in a bespoke way
There is a general lack of a consensus around 'best practices' and its a mess of libraries and patterns.
Its the 'Android' phone ecosystem where the 'loved' langs have passionate communities and accepted best practices.
That being said, java and the JVM are well tested and understood systems when you care about observability, operations and scale more then just banging a feature out.
3
u/puppeythanthien Dec 30 '21 edited Dec 30 '21
I know many people here donât want to hear that but I would say this. Almost people here compared Java with Python, JS: strongly typed, not to make toys⌠as if Java is the only one strongly typed programming language. I will compare it with other modern strongly typed languages like TS, Swift⌠and Java is:
Old
Ugly: in syntax
Slow: need 2-3x more line of codes for same task
Not really safe compared to other strong type languages (new languages handle null exception and optional much better )
2
u/RomMTY Dec 30 '21
I blame some 00' "enterprise" architects/developers that build way over engineered software that made it into production and over the course of the next 20 years younger developers had to maintain.
It's like how PHP used to be very quirky and nobody used it to build "serious" enterprise software, but it evolved and outgrew it's quirkiness because nobody was forced to maintain "enterprise" software writed in it.
I love java, it was my first language and love everything about it.
2
2
u/msx Dec 30 '21
I think it's for the following reasons:
Java used to be pretty verbose. Anonymous classes, getter and setter, generics, etc. Now it's much better but the idea still lingers.
Java exceptions are pretty difficoult to grasp for newbies. They are a huge source of frustration and hate. And not only for newbies!
Java is the language you often learn in school or university. As any forced knowledge, you hate it.
2
u/christoforosl08 Dec 30 '21
Its just too verbose. And sometimes more complex than it needs to be. Read: application servers
Even though I work with Java 90% of my time , I can't help but marvel at C# everytime I switch for a project
2
u/Jezoreczek Dec 30 '21
I personally love Java, but there are so many objectively better alternatives (e.g. Kotlin) that it's hard to justify using vanilla Java. It's tedious to write in comparison.
2
Dec 30 '21 edited Apr 17 '26
If you're reading this, the original post got nuked by Redact. I use it to automatically purge my digital footprint from social networks, people search sites and messaging apps.
teeny versed dinosaurs terrific door reminiscent axiomatic price fall employ
1
u/spectrumero Dec 30 '21
My (historical) dislike of C# was that it was "multiplatform" in the sense that Windows XP and Windows Server were considered as different platforms by Microsoft. C# treated all other operating systems as second class citizens (and to an extent still does - IIRC, Microsoft still hasn't made available any of the GUI stuff on platforms other than Windows).
2
u/strogiyotec Dec 30 '21
I thought it's about the language syntax , but Java's syntax is one of the easiest in the market(Golang can be easier as some people say , but I don't agree)
Then I was thinking about the code base and I stuck with this option. It's relatively easy to find a Java developer, a developer who doesn't understand SOLID and just copy paste from stackoverflow, as a result the code becomes unmaintainable and people get frustrated working with it . I personally was because most of my time I am working as a freelances or consultant and get an opportunity to see hundreds of Spring/Hibernate/Tomcat projects that have performance/maintenance problems just because people didn't bother to read docs to understand how connection pooling works, what is lazy loading, what is open session in view or what Spring context actually is. Rather than that I saw a brilliant java codebases , just to give you few here is a small example
So to answer your question , people are frustrated to support poorly written codebases which happen to be dominant in Java market because the low entry point. Languages like Rust are new and usually used by devs with plenty of experience(unlike Java which is the first language to all juniors) as a result code bases of those languages are smaller and more enjoyable to work with .
2
u/Better-Internet Dec 30 '21
It gets the job done and it's super mature. However it's old, frumpy, dowdy and some of the syntax is clunky. It's very well established for backends.
One annoying aspect is you can't easily take java code and "run it" w/o tools such as an IDE, script, or Launch4J.
Java-based UIs have a clunky legacy. When I see the steaming cup icon I still have this mental image... Slow ass ugly app that'll take a long time to launch and sometimes periodically freezes due to GC.
1
u/Rorasaurus_Prime Dec 30 '21 edited Nov 14 '25
consist office lavish command tender truck reach dependent strong dinosaurs
This post was mass deleted and anonymized with Redact
1
u/Dr-Vader Dec 30 '21
seems odd to me that groovy is more dreaded than java - I feel like in terms of ease of use groovy makes java a bit less nit picky. makes me wonder how much peopple actually konw about the languages they're voting on
1
u/ventuspilot Dec 30 '21
IMO the survey shouldn't be called "loved vs dreaded languages" but rather "languages with the most vocal supporters vs most vocal haters".
Rust obviously leads due to it's almost cult like followers, Java is way down because non-haters just use Java without talking that much about the language itself.
ORANGE CRAB BAD!!!
1
Dec 30 '21
Some people really enjoy functional programming, which is sad, because Java incorporated a bunch of functional utility 6 years ago.
1
1
u/rpgFANATIC Dec 30 '21
Turn that idea on its head
What features do other languages have that Java could benefit from?
1
1
1
u/elrado1 Dec 30 '21
It is old good and boring. For me it feels like home. I was doing quite a bit python and csharp work but returning to java always felt good.
1
u/varunu28 Dec 30 '21
Have you ever noticed that whenever a new shiny language comes in and people start giving the intro tutorial, they start with a hello world program. For this program they compare it to a similar program in Java and put a chip on their shoulder by saying that you don't need to write bloated public static void main just to print a string. But somehow its always a comparison with Java. It is because Java is the industry standard. No matter how many people hate it and write blog posts about it while comparing a new shiny toy, it is what gets the job done.
We are using a hammer or a screwdriver for god knows when. Its a basic tool and it does few particular tasks very well. Same goes for Java. It's boring. It's not as fancy as a Swiss army knife. You can't write a one line script that reads a file, sorts it and sing a Christmas carol for you. But it gets a job done and that is what matters. It is in programming job where I have seen people are more proud of the tools they use than what they accomplish with it. I am yet to meet a surgeon who comes out of a failed surgery boasting about a fancy new scalpel they used. We are paid to solve problems. If the problem is already solved in an efficient manner in one programming language then there is no use of rewriting it in another one just so that you can program in that language.
So people who hate Java either haven't worked on a large scale project to see its power beyond the hello world program or fail to realize the maintenance cost that comes along with introducing a new tool to solve a problem that is already solved efficiently in Java.
P.S. I am not a Java evangelist and will happily switch to another language if the problem that I am trying to solve has a better solution in that language. I am just not in favor of programming in a language just in order to broadcast it out to others.
0
Jan 04 '22
[deleted]
1
u/varunu28 Jan 04 '22
When I say comparison with Java I also provide context along with it. The comparison with Java happens whenever the language author has to describe how easy is to write and compile a starter program in the new language as compared to Java.
Comparison with C and C++ can be in other aspects such as memory allocation or concurrency primitives but when it comes to representing the ease of getting started with the language, I have mostly seen it done with Java. Mostly due to the fact that while running the hello world program, the person learning Java for first time doesn't have any context on what each of the
public static void mainkeyword means. It gives the language author a chance to present an initial win for the language they are teaching over Java.
1
u/minato3421 Dec 31 '21
Most of the criticism comes from people who've just started their journey with Java and are shocked to learn that it isn't as easy and convenient as python or javascript. It forces you to do things in a certain way and involves a lot more boilerplate code than usual.
1
u/almson Dec 31 '21 edited Dec 31 '21
Java's problem is that it's not known as a serious systems language. It gets compared to scripting languages like Python, Ruby, etc, and called verbose and even obtuse, when it should be compared to C++ and called a godsend.
Contrast this with Go, which is a very trendy language despite being verbose, obtuse, and GC'd. It's because Go gets compared to C and Rust, not Python. Perhaps Google's marketing has to do with it. Sun advertised (and evolved) Java primarily as a web programming language, pitting it directly against scripting languages and making it difficult to use for systems utilities. The startup time is awful (not because of bytecode, but because Sun/Oracle doesn't care). None of the GCs have a "just try to minimize RAM" heuristic (they all want to be given MaxHeap). And native interop has been a pain.
Java could have been more respected if it positioned itself correctly. Of course, I like it. It really is a lot better than C++!
1
u/Aphix Dec 31 '21
It's overly verbose and has a bloated standard library which results in poor cold start times and large resource footprints when compared to basically any alternative.
1
1
u/bishamsingh Jan 04 '22
Java is pretty cool but itâs better to be language agnostic. Itâs just another tool.
1
u/_javabean Jan 16 '22
Firstly, Iâll preface my comment by saying I am obviously biased. I learned on Java and transitioned to Kotlin. I honestly have a hard time looking back at all Javas redundancies. Although, Kotlin builds on Java, the ease of use, safer, and less redundant code makes it so attractive as an alternative to Plain ole Java⌠Just my biased two cents đ¤Ł
1
u/Ailiyak Jan 19 '22
Because it is old and many people cant catch up with salaries, it is better for them to have something newer where the most experienced person has only 3-4-5 years of experience so they can catch up :)
1
Jan 25 '22
I've been working with java since java 1.5 and I still like it. Have you tried using mason templates, ruby on rails, assembly, perl? You'll get real nightmares and white hairs from that.
But Java is just a tool. Pick the appropriate tool for the job. You won't be writing java applets just because you like Java and you probably won't pick soap XML for greenfield projects. Java won't be appropriate for every case but it's a solid pick for a lot of enterprise cases because it's a very mature language.
It can also be fun for challenges. For example, try to get 90% of your web application serverless requests to be under 100ms execution time with a function that has networking and IO. And only valid if you run a load test or at least 100 requests (I know not too many but better than 5). You are probably going to say, why not use c++, go or nodejs? Well because then it wouldn't be a challenge :)
1
u/SerialBrain3 Jan 29 '22
JVM is great. Libraries are great. Java is tedious to write tho. Other JVM-based languages like Clojure are getting a lot of love in that survey.
1
1
u/vitalyx May 11 '22 edited May 11 '22
- verbose syntax, no standalone functions, at least records were introduced (like 50 years after other languages got them)
- heavy, slow starting IDE required or used in practice most of the time
- complicated project structure (stuff got even more complicated when modules were introduced)
- tons of configuration options everywhere, can't just run your app; classpath, JVM version, build tool plugins, have to get everything just right just to run
In practice, with most Java repos it's not as simple as this:make && ./run // Ccargo run // Rustyarn && yarn start // JS
- equally verbose and overcomplicated frameworks
- often used in slow moving environments with a lot of bureaucracy
- second class GUI
- apps perform well once warmed up, but startup is slow and memory consumption is heavy, especially for smaller apps
- harder deployment
- limited utility (compared to JS or C# for example, where both can be used for GUI/games too) - this one is more in the "don't care about Java" category rather than hate
BTW, I don't say these are absolute truths. But it's a perception of someone who spent a few months tinkering with Kotlin/JavaFX for many personal projects. I did like Kotlin/JavaFX a lot and JVM/JDK that enabled them. I also think IntelliJ is a great IDE. And I don't see anything I said above as a contradiction.
1
u/kcombinator Dec 30 '21
I dislike Java the language but don't mind the JVM as a platform. It would be nice if Jython was more active and updated, for sure.
1
u/kubelke Dec 30 '21
Because itâs perfect at every level /s
Look at other results, newer = more love
1
u/reqdk Dec 30 '21
Java is still taught in schools. How big do you think is the proportion of students who don't really like what they're studying? Lol.
Professionally, well, developers are a really tribal bunch. Go over to the ruby and rails subs if you're looking for fun in that area.
Besides, you can find something to bitch about in any language if you spend more time with it. I have yet to find an exception to this, no matter the tool or language that I've used. So if Java is indeed one of the most dreaded languages, it's probably in a good place. I say probably because you'd also have to look at what people are bitching about, which fortunately for Java, is usually silly stuff.
1
u/devcexx Dec 30 '21 edited Dec 30 '21
It always depend on your point of view.
As a computer science enthusiast, coding in Java is extremely boring. It is true that the language has improved these last years since Java 8, but it is still incredibly verbose and lack of features than are present in more modern languages (e. g Rust, Go, Swift). Also, people usually tend to code with it using more old and error-prone approaches, because the language doesn't offer better ways around: loops full of mutability, unsafe nullability (the memes around NullPointerException are not casual) manual encapsulation, intense usage of runtime reflection (which is basically like pooping on top of the concept "type system"), etc. From the point of view of coding as a hobby, my position is clear: if you like to code stuff in Java in your free time, it is probably because you haven't tried other languages enough.
In a professional environment, however, Java was early adopted by companies and now it is in the "core" of most of the applications and tools inside a huge amount of companies. Java nowadays have good tools for testing, code coverage, etc, which is important to ensure the quality of code, so it makes quite a lot of sense to be there and to have people maintaining that code. Also, it doesn't make any sense for most companies to entirely migrating applications out of Java solely under the argument that "java is bad".
Said that, that doesn't mean you can push a little bit harder and start proposing to develop new libraries, features, etc in other JVM languages such as Kotlin, which is almost 100% compatible with Java, even inside the same project, and has Google as a backer and maintainer. I'm not mentioning Scala because stuff like having its own classes and types for handling collections, will make it more complex the interoperability Java. But that's not the case for Kotlin, and it gives you a lot of features that then you'll miss if you switch back to Java. For me at least, based on my experience, I found almost no arguments to the question "Should we do this in Java instead of in Kotlin?" because they're languages that their use cases almost overlap. For example, if you're working for a company that wants to create a new Android app from scratch that will consume an API and all that, the classic kind of app basically, in (almost) 2022, if you decide to go with Java instead of Kotlin, it is probably because you're into some sort of sadomasochism or something.
0
u/lqstuart Dec 30 '21
Asking people what programming languages they love and which ones they dread is every bit as stupid and pointless as asking them what human languages they love and dread
2
u/ArmoredPancake Dec 30 '21
Mmm, no? It represents willingness of people to work with a language and how they're satisfied with a language.
0
u/ivancea Dec 30 '21
My major problem with Java is the lack of features, like operator overload, functional programming (Streams is just a bad designed wannabe when compared with LINQ), generics without type erasure (not a big deal anyway, but pretty interesting sometimes), async...
In the overall, it's ok. It just evolves very slowly
207
u/taftster Dec 30 '21
One thing I've found is that Java often represents "boring" work.
Java is used for in real software that many brick & mortar companies rely on to operate their business. Java is not the new shiny thing, but is often the workhorse powering many back-office applications.
Backend customer management or accounting software applications don't necessarily appeal to people in these types of surveys. It's so very easy to want to chase the next cool thing.
Nothing wrong with Python, Rust and the other favorites these days. But Java is still very much ubiquitous and used heavily throughout industry, regardless of what a survey says.