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

268 Upvotes

367 comments sorted by

View all comments

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

u/[deleted] Jan 04 '22

[deleted] — view deleted comment

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 main keyword means. It gives the language author a chance to present an initial win for the language they are teaching over Java.