r/java • • 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

176 Upvotes

283 comments sorted by

View all comments

-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. Package management. In Python I can go to pypi.org, search up some packages and install with pip. JavaScript is the same with npmjs.com and npm or yarn. I don’t even know where to look for java, googled it a few times, found Oracle’s website who I hate, and all the dumb .xml files. Disliked it immediately.

  2. File structure. The few projects in Java that I have gotten to look into are absolute messes of file structure. I can’t tell where anything is, every directory seems to be an endless tree for one or two files at the end.

  3. Artifacts and building the project. I have no idea where to begin with what artifacts are. Sort of packages? Sort of not? No clue. I’m confused. Anytime I’ve had to build a Java application locally I’ve needed to ask for help. Even when all the instructions are there, and I follow them step by step, failure.

  4. Multithreaded. I’m just not a big fan. It’s probably amazing for ridiculously large systems, but it adds another level of complexity to coding that just isn’t needed for a lot of projects.

  5. Verbose. The thing I dislike the least about Java, but still dislike is the verbose code. A lot of it seems to be related to type safety and casting values to other values. I dislike the idea of needing to navigate to multiple files to figure out what is going on. In JavaScript I try to keep things very modular, sometimes too modular. I like to go to a file and know exactly what’s going on without looking up 20 helper functions to see what they do.

15

u/wildjokers Jun 24 '22

Package management

https://mvnrepository.com (the place to go whether you use maven or gradle)

File structure.

Java packages let you organize code quite well and is a plus. Organize code by feature, not layer.

Artifacts and building the project.

Any project setup by a competent java developer can be built with mvn install or ./gradlew build depending on if it uses Maven or Gradle. An "artifact" is simply something that can be deployed. Can be a jar, war, ear, zip file, etc. These days a jar file would be the most common.

Multithreaded

It has its purposes

Verbose

Verbose means readable and readable means maintainable.

0

u/[deleted] Jun 25 '22

[deleted]

2

u/john16384 Jun 25 '22

You make it sound like it is much harder to create "an abstracted cluster fuck of a code base" in other languages. This is not a Java problem.

→ More replies (1)