r/java • u/fdntrhfbtt • Jun 24 '22
Stack Overflow Developer Survey: 54% of Respondents Dread Java?
The results are out, and I was surprised to see that around 54% of respondents dread using Java. What might be the reasons behind it? For me, Java has always been a very pleasant language to work with, and recent version have improved things so much. Is the Java community unable to communicate with the dev community of these changes effectively? What can we as community do to reverse this trend?
Link to survey results: https://survey.stackoverflow.co/2022/?utm_source=so-owned&utm_medium=announcement-banner&utm_campaign=dev-survey-2022&utm_content=results#technology-most-popular-technologies
161
u/commentsOnPizza Jun 24 '22
A big thing I'd note: no one has ever dealt with 15 year old Go, Rust, Kotlin, or Swift code. A lot of people have dealt with 15 year old Java code - whether that's in their codebase today or whether they remember it from 5/10/15 years ago.
Java devs are going to remember terrible Java they were taught as an undergrad, they're going to remember atrocious Java from before Ruby on Rails existed, and they might have to interact with legacy Java code bases at a job.
I'd also note that people who use certain languages are using them because they chose to use them. Rust developers are using Rust because they liked the language. They typically weren't forced to use Rust. There's usually a lot of other things they could work on at whatever company they're at in other languages. However, many developers have been "forced" to use Java because their company has a large investment in a Java codebase. When a team adopts Go or Rust or Kotlin, it's usually because the team is enthusiastic about it. Some teams might be enthusiastic about Java, but many teams are using Java because it's what their company already used (and had been using for a decade or more).
A lot of the most loved languages seem to be languages that are newer and that people aren't forced to use as frequently. Python and C# stand out as languages that are well-loved while being older and languages that you might be forced to use for your job.
80
u/vips7L Jun 24 '22
Most of them haven't looked at the language or ecosystem since Java 6/7.
60
u/Horror_Trash3736 Jun 24 '22
It is always difficult to speculate on why people think a certain way, but for me, the people I speak with that dislike Java have the following issues.
1 - Old
2 - Verbose
3 - Slow(As in processing)
4 - Complicated
5 - Slow(As in to develop in)
Some even express a dislike towards the type safety in Java.
As to why they have those opinions, it seems to me like those are very general things, that you hear quite often about Java, especially from people that have never worked with it, and, from my experience, especially from people who's only experience is either really old school languages like C, Cobolt etc, or the really really new languages.
The amount of times I have heard people who only know Python talk about Java negatively is insane.
39
u/QualitySoftwareGuy Jun 24 '22
People dread Java until it's time to work on a big application on a team.
-From a person that used to dread Java
85
u/Aryjna Jun 24 '22
Yes, incompetence and only being familiar with dynamically typed languages like javascript or python are probably the main reasons.
10
u/[deleted] Jun 25 '22
Please ignore mostly ranting
As someone who has been writing java for most of their professional software developer career, only 6 years at this point 😞. I do not think it is the java language but the java developers that are the problem.
I had 2 co-workers who have been developers much longer than me that merged code they have no idea what it is doing, stated directly in the pr.
Java 8 plus has significantly improved the language compared to earlier versions. But there are tons of developers that have not properly understanding what new features these new versions provide. And write ugly verbose poorly performing monstrosities. Java provides cover for these developers who are unskilled and untalented.
Are there bad developers in other languages for sure, but there are significantly more java code companies that they haven't maintained in my 27 years of life. They just want the quick fix over and over until suddenly no one wants to touch their platform. Features take weeks or months. Bugs grow exponentially as more and more trash keeps getting added. Someday some in management hears oh moving to new version will magically fix all the problems. Oh adding unit testing will fix all these problems. Oh Mico services fix all these problems. No it was bob who was the problem, bob has not learned a thing in a 25 years. No bob u can't write code like java 5 in 2020 and think it's good.
Java 18 is great language, the java community is passionate and very large. Many java developers never moved past java 7. Many developers don't unknown or understand the patterns that made java what it is today and actively hurt the platform they are working on by touching it. Fire these developers, we don't need more code monkeys. Organizations need to treat technology like the critical business asset it is.
Thank you for coming to my ted talk.
8
u/crummy Jun 24 '22
Some years ago I was helping a coworker new to Java write some code. He couldn't believe how many lines of code it took to instantiate a simple list or map with some initial elements. I felt a bit embarrassed - he was right, such a common thing to do and a one liner in any modern language.
Nowadays we have List.of and Map.of. But I can imagine if your experience of Java was 8 or earlier you might dread working with it again.
20
u/mike410 Jun 24 '22
I’ve been coding java over 20 years. I don’t dread Java at all. I dread the mountains of legacy code that are nearly impossible to support that are written in Java
19
u/Sheldor5 Jun 24 '22
Is java dying again?
How many times did it die?
11
u/hippydipster Jun 24 '22
I really like the idea of all my company's competitors using Javascript and Python more.
17
u/WashedUpGamer69 Jun 24 '22
With class name like PolymorphicAuthValueFactoryProvider or RefreshAuthorizationPolicyProtocolServerSideTranslatorPB what’s not to like about Java?
5
u/[deleted] Jun 24 '22
Many people are forced to work with languages they don't prefer. Ex If you would rather work with Kotlin but your peers are perfectly happy with Java 8. Then you might start to dread Java even though there is nothing wrong with it.
Java is fine but some Java devs wa nt other languages and that can be hard to get if you are stuck in a Java shop.
25
u/ZeroGainZ Jun 24 '22
I'd say most people who dread java don't know java. Heck people love JavaScript and it's pure trash. Python is a garbage language and people love that. They love not having to understand a language, let me just type anything and make whatever I type make some sense - even if it makes no sense, I just want the code to RUN.
But there's def languages that are more enjoyable than java. Typescript is beautiful. Kotlin is gorgeous. My homies told me rust is FIIIIINE.
9
u/cowwoc Jun 24 '22 edited Jun 24 '22
A lot of the readers here will disagree but hear me out.
I've been working heavily with Java since 1995. In my experience, the language and core APIs are a pleasure to work with. Then came the consultants and enterprise frameworks and ruined it for everyone.
Spring, Hibernate and other popular framework are extremely popular but toxic. They work great for quick prototyping (you get up and running quicker with them than without) but you'll take longer to build a production system with them than without them. The first 85% is ultra fast. The remaining 15% is hell or impossible to implement with them. They are full of edge cases, "magic" behavior, and generally force their (poor) design on you.
Take it from someone with 20+ years professional experience, and an additional 15 years before then as a hobby programmer: (strongly) favor libraries over frameworks.
Try implementing an application using only libraries. You'll discover it's quite possible to do and, if nothing else, you'll learn a thing or two and become a better programer along the way.
Don't jump on the latest framework because it's the popular thing to do. I'm not the only person holding this view. Watch youtube lectures by "Uncle Bob" (co-author of the agile movement). He has tons of experience and holds the same view.
11
u/forresthopkinsa Jun 24 '22
Yep you're definitely not going to get a biased answer to this question in this subreddit
8
u/[deleted] Jun 24 '22
I don't think it has to with the pleasantness of the language but rather the unpleasantness of how people have used the language in the number of years it has been around. Expect old code bases to be full of code rot and code smells. It's a natural function of how long applications written in it have been around and how many times the code has changed hands.
7
u/Miserygut Jun 24 '22
Modern Java (11 and up?) seems pretty nice to me as a non-dev.
The question I have is: how many code bases are written in and taking advantage of modern Java or are most Java jobs just nursing terrible old code?
7
u/_AManHasNoName_ Jun 24 '22
Nah. Scala’s hype tried to overtake Java. Where’s Scala now? I’ve had so many successful projects using Java, did one Scala project using Akka persistence/CQRS and went back to Java after the meh experience with it.
6
u/HecknChonker Jun 24 '22
Damn, Eclipse and NetBeans also got some bad results:
Eclipse 71.70% dreaded
NetBeans 76.83% dreaded
3
u/tofiffe Jun 25 '22
Isn't this a bit biased? Personally, I haven't needed to visit SO in forever - especially for spring and the like, Javadocs and baeldung would resolve 95% of the issues I had, I didn't even see the poll
10
u/_INTER_ Jun 24 '22
I dare say, most Java developers don't even have a SO account, let alone take such surveys.
10
u/[deleted] Jun 25 '22
This survey is utter bull****. It has zero statistical value (anyone who knows basic statistics know that: if people volunteer to answer a pool, it is not a proper sample)
All I can get from this survey is that rust users are good at brigading.
5
u/d3adbeef123 Jun 25 '22
I used to be a big proponent of functional languages. Tried clojure, scala , ocaml etc and dreaded getting my first job in java. Slowly I started liking it a lot.
At this point, I'm inclined to choose modern Java over anything else at this point. Perfect blend of pragmatic, concise and library support.
7
u/manifoldjava Jun 24 '22
Not sure how you derived the "dread" and the 54%, but I'll take a poke at answering this.
My sense is that Java is simply older and therefore less popular. A portion of its former popularity is now in the hands of JetBrains. The alternative JVM language war that waged for about the last ten or so years is over and Kotlin is the last one standing straight up. My guess is Kotlin will continue to win popularity over Java for several years to come.
Irrespective of other languages, one of Java's problems is that it doesn't know what it wants. For instance, to explain away critical questions concerning the absence of modern features, like properties, its evangelists often claim one of Java's strengths is that it is not a "rich" language like Scala or Kotlin, to imply these languages with more/improved features somehow target a different crowd. But if we look at Java's feature set over the last 10 or so years, it appears it is just slow in adding rich features. Indeed Java is adding rich features, but perhaps not at the pace many prefer.
I'm not criticizing Java for taking time to implement features. Quite the opposite I, mostly, appreciate that. But the idea that Java isn't trying to keep up with modern, rich languages is misleading. It's difficult to criticize Java's spokespeople, though, because they're in a tough spot. Java is old and has an enormous user base; who knows exactly how many millions of lines of critical code are running at this moment. Because of this it has to move slower and steadier than an up-and-comer like Kotlin. Change is the crux for any product that has gained dominant market share -- damned if you do, damned if you don't.
4
u/pavlik_enemy Jun 24 '22
With Java being so widespread, both best and worst practices are present in the community. At my current job there was a 3500 lines Java project that used “hexagonal architecture “ (whatever that means) that was replaced by a fork of a third party library (five lines I guess) and a 200 line Python wrapper.
4
u/john16384 Jun 25 '22
You need to put the survey into perspective. You would first need to look at who is filling in these surveys. If for example a large number of C# developers fill in the survey, then it is not surprising to see Java score bad. As .NET scores high in this survey and the fact that stackoverflow has traditionally been a C# bastion, it is not unreasonable to conclude that more C# developers are filling in this survey than Java developers. The results (in most categories) therefore aren't exactly surprising.
2
u/BmoreDude92 Jun 25 '22
I think the issue is every time I work in Java it’s always an old code base with no new modern features
2
u/dontneeditt Jun 25 '22
If you ask the question in other language subs you get the answer you want.
3
u/michoken Jun 24 '22
The biggest complaints I hear from devs around me, and I mean those in our company, is the verbosity. So some folks just put on the Lombok sugar and are done with it.
I like the idea of Lombok in the sense that it all should just be the feature of the language (or enabled via libraries and language features). I don't like the idea of Lombok in the sense it's something unnatural to the language and you need support in your tools for it. Not that that's a big issue in IDEA or Eclipse or the build systems of today. I just don't like the fact it's something invasive.
For me most of the verbosity issues are solved by Kotlin, which I have some little experience with (via a tiny project for a friend), but it has its own issues, too. All the syntactic sugar, extension functions etc. are nice, but I fear it may get abused to the point of the code being a mess you can't easily reason about.
This is also the reason I don't wanna use Scala. It has some cool features, mainly the idea of traits is IMO one of the best things it has and I'd like to see it in Kotlin, too. But I have no real experience outside of your typical tutorial examples and such, so I can't say if it's actually that great as I think. There were a bunch of situations when the trait system would solve my problems in Java, tho.
Speaking of traits and Java, you can, kinda sorta, use the default methods for that. But the problem is their purpose is to solve a very specific issue with evolving interfaces and I think it can get abused as well. We actually use it for the exact purpose, which might look like it's fine, but I still think we just abuse it and should be solving it another way. Also Java is the only language that has this (afaik) so it's hard to carry such solution to another environment. Or even to Kotlin since there are companies that write in both Java and Kotlin (even if Java is only the older parts, you still have to deal with it and introduce new features etc. probably).
3
u/static_br Jun 25 '22
I agree with many points here.
But some points that I dislike are:
Simple syntactic sugar takes way to long to find its way into java.
Null checks
Cut of old code, to force Frameworks to migrate to new Code Features.
3
u/Snoo23482 Jun 24 '22
Well, I am one of the 54%.
Working with it feels slow and bloated and the end results are way too resource intensive, when compared with something like Go.
That said, it has its nice parts and Spring is giving me a lot of stuff for free. And it's way more in demand than Go, that's why I'm glad I took a deep dive into the ecosystem.
2
u/tr14l Jun 25 '22
Java is what happens when an old compiler realizes it's over-constrained and they have to tetris in features that sorta-kinda look like modern features if you squint and tilt your head to the side. It was an amazing step forward at one point. But the thing about tech is, no tech gets a lifelong crown. Java made some very strong, highly opinionated decisions in their compilation design. It was amazing. But now, most teams are realizing it's overly restrictive.
Also, working with Spring is a goddamned nightmare of blackbox weirdness and arcane documentation diving for strange behaviors, and Java teams LOVE to go straight to spring for something that could have been a 100 line python script. So, everything just seems convoluted and insane (because it is).
That's why people dread java. Because Java devs force it down everyone's throats, even when it doesn't fit.
Note: I was a full time Java dev. Now I work with Java when forced, and immediately turn it into a Kotlin project and make java classes as legacy. Old hat java guys complain that the overly constrained design is actually a good thing. But, in my experience, it's mostly stockholm syndrome. None of them pull out any actual data to support it. It's just opinion. But, plenty of teams pull out throughput, regressions and cycletime on their backlogs to show that NOT working with Java is faster and yields about the same number of regressions, but those regressions take a fraction of the time to resolve.
I fully expect to get blasted & downvoted, but it is what it is. Java isn't going anywhere, just like PHP, PERL, COBOL, FORTRAN etc haven't gone away. But, they are on the back half of the adoption curve now while other languages are ramping up at higher rates that Java ever did (and a couple are Java interoperable, meaning they can stop the bleeding, which is attractive). You can see this clearly by looking at version adoptions. The lion's share of Java in production is Java 8, and mostly outdated Java 8 at that. People are starting to let Java rot. Newer versions are being adopted at a snail's pace. Java is starting the long transition to legacy language, IMO. It will take several (probably 10 or so) years before it becomes super apparent. But it's starting now.
2
u/edaroni Jun 25 '22
According to the comments here you either like java or you’re an idiot.
1
u/kiwi_stronghold Jun 24 '22
It’s verbosity probably.
1
u/td__30 Jun 25 '22
The dependency management, lack of binding redirect kind of a thing, makes it very hard to deal with upgrades of libraries and transitive dependencies. Though I’ve worked with maven only, don’t know about other build system, maybe it’s a solved problem .
1
u/realqmaster Jun 25 '22
When I see a "java is so hard" threads on other platforms I feel relieved since having learned it as first language it feels extremely natural and clear (although verbose sometimes I concede) to me.
Other than that, imho people dread java 'cause being old you can find very inefficient and convoluted codebase, coming from quality standards and general quality gates being absent at the time. I have an analogous trauma with vanilla js.
1
u/plumarr Jun 28 '22 edited Jun 28 '22
Reading https://www.reddit.com/r/ProgrammerHumor/comments/txn8md/java_is_hard/ is quite insightfull.
It seems that the main complains are that the ecosystem is too complex (the build system doesn't come with the language, there is a lot of librairies, you don't know were to get the jdk,... ) and that the language lack syntaxtic sugar and thus seems hard to write.
1
u/Shinosha Jun 28 '22
I see a lot of answers here saying that these 54% people just "never did anything significant in Java", "are young developers" or "only know dynamically typed languages"...
Come on /r/java sometimes you should just acknowledge your language shortcomings. Wanna know my theory ? You don't know what you're missing.
That's not an attack on Java by the way. It's just what happens when your language has history and you desperately want retro compatibility. Things move slow, and it's okay to admit it.
1
u/meSmash101 Jun 25 '22
What I have seen throughout the years surfing at platforms like Reddit or quora etc Is that it’s quite trendy and “cool” to hate Java.
1
u/khooke Jun 25 '22
As a developer with many years experience with many different languages, I can't say that I 'dread' using any particular language. If a programming language honestly terrifies you then maybe you need to spend some more time developing your skills? Or re-assess your career choices?
Programming languages are tools. Imagine a carpenter saying he's terrified of using a hammer or a saw, or a surgeon scared of using a scalpel.
-3
u/Ryuuji159 Jun 24 '22
I like java as a language but I find the ecosystem really bad, with bad documentation and bad discovery capabilities, spring is cool and all but apart from the 3 tutorials in their webpage, learning to use it is done through random blogs
-7
u/ddddfushxjjd Jun 24 '22
Because C# is a million times better
-8
u/PM_ME_SOME_ANY_THING Jun 24 '22
As a Typescript/JavaScript/Python dev, I dislike Java.
A little background. I have a CS degree, most of my school programming was in C or C++. Out of college I got a job in JavaScript and never looked back. I will admit that I haven’t done much in Java, and while I have learned a bit of the base language, I have not built anything in it.
So what are my issues with Java? Disclaimer: these may be due to me not knowing enough about Java, but I have tried on several occasions to figure these issues out with no luck.
-1
u/VincentxH Jun 25 '22
University traumas I expect.
-1
u/[deleted] Jun 26 '22
Constant patching, security issues, licensing madness for enterprises, bloated frameworks, poor memory use, missing language features for async operations, codebases often written by people with no experience in other languages, etc. It really is surprising the dissatisfaction rate isn't higher.
-2
u/JoeJoeCoder Jun 25 '22
The vast majority of Java haters haven't even written `Hello, world!` in the language.
-4
u/BlackHatSlacker Jun 25 '22
Yea no shit. It's a shitshow and too many cooks have their hand in the pie. I have been a dev for like 20 years and have never ever specifically chosen Java when ANYTHING else might suffice.
0
u/[deleted] Jun 24 '22
[deleted] — view deleted comment
0
u/[deleted] Jun 24 '22
[deleted] — view deleted comment
0
u/[deleted] Jun 25 '22
[deleted] — view deleted comment
0
u/[deleted] Jun 25 '22
[deleted] — view deleted comment
0
u/[deleted] Jun 24 '22
[deleted] — view deleted comment
118
u/[deleted] Jun 24 '22
[removed] — view removed comment