DEV Community

Sam Reghenzi
Sam Reghenzi

Posted on • Originally published at samreghenzi.it on

The post I link when someone tells me that Java sucks

The post I link when someone tells me that Java sucks

I had the chance to use other languages as well, but I spent the most part on Java or on JVM based languages. I had the chance to use also other languages (python to name one I absolutely love).

In all these years I had to handle a lot of “Java sucks” conversations with people religiously in love with the language of the moment. So I resolute to write this post and link it whenever … a shit conversation that happens. I will present my point in favor of Java/ JVM based environment with a big bold disclaimer:

I DO NOT think that Java is the best language in the world and I love to learn new stuff. At the time of writing, for the stuff I’m working on is just the best (IMHO) Option available.

These are the top 5 reasons people usually try to persuade me that Java sucks

Java is slow : this is plain wrong. Big data solutions ( spark, hadoop ) are all built on the JVM. Speaking of internet performance, Java solutions are the most performant ones after native engines: here you can check some data. Maybe it was true in the past ( 10 years ago). Maybe GUI application built in Java is slower than a native one, but it is oblivious since native will always outrun a virtual environment.

  • Java is verbose: What are we talking about here? The lack of syntactic sugar? The historical tradition to make all properties private than accessed with getter/setter methods? In modern Java ( 1.8 ) you can write pretty concise code with static imports to build quick DSL, annotation and annotation parser to build meta programming stuff, closures. There are historical reasons for some of the design choices. Let me quote this answer on Quora: Why is java so verbose?

The philosophy behind Java is evident in that it insists on making the programmer explicitly type out what they mean rather than providing syntactic sugar. For example, to create a derived class you use the word “extends” rather than “:” as in C++. There is no user-defined operator overloading. Naming conventions in Java result in very long names. Etc. Etc. The idea was to make a language which prevented novice mistakes and abuse. Java was basically a language designed by experts for non-experts

How PayPal Scaled To Billions Of Transactions Daily Using Just 8VMs

What startups or tech companies are using Scala?

**Framework X / Java EE is over-engineered: **maybe… don’t use it. There are plenty of options. Java EE is a very broad variety of technologies and opensource frameworks that offer alternatives pops up every even day. Probably the real problem with Java is that products ( from commercial application source to open source lib) became feature bloated in time. I think because most of them are bound to enterprise development and that kind of market ( which I know pretty well) is a curse with the “adding features” madness. And then poor design also happens. I saw it with projects like Hibernate: I used it since version 1.28 and I witnessed it becoming a huge juggernaut entangled with hundreds of dependencies. When this happens probably people think it Java fault … it’s not.

**Java is not open source / backed by corporations with evil intents: **maybe you lived writing PHP scripts in a mobile house with limited internet connection for the last 10 years. In that case, have a look here to the OPEN JDK.

If you want more details on the Java/JVM ecosystem to have a look at this article series by Geert Bevin10 Reasons Why Java Rocks: Part I | zeroturnaround.com _When I was away from Java to work on the software of the Eigenharp instruments, I had to develop cross-platform real…_zeroturnaround.com

This is going to be a “work in progress“ blog post since I think people will find always new reasons to rant.

Top comments (1)

Collapse
 
ecyrbe profile image
ecyrbe • Edited

All these points should not be necessary. You run with what you are confortable with and what suits your needs.

Of course, nobody should have tech religion, meaning you should not mind switching technologies if they are suited to the task. It might not even need to be the most suited technology for the task, because sometimes you need to deliver fast and you go with what you know. There is no shame in admiting that.

I would say that today, if you are doing embedded device work, you might go with c/c++, maybe Rust. if you need to do REST APIs, you might go with Java / C#, maybe javascript/typescript. If you are doing data science, you might prefer using Python / R, maybe scala, if you are doing web you might go javascript/typescript, maybe C# blazor , if you are doing mobile... you get the point.