DEV Community

Cover image for Why you do not like Java?

Why you do not like Java?

Victor Osório on June 02, 2020

I have seen the StackOverflow Insights about Most Loved, Dreaded, and Wanted Languages and I have some questions. If you are not a Java developer o...
Collapse
 
vepo profile image
Victor Osório

Yes, I think one of the strengths of Java is the JCP.

If you think that Node.Js has tons of frameworks and you have to learn each framework. With Java, there is no such thing. You learn Jakarta EE and you can use it with Quarkus, JBoss, Thorntail, TomEE, etc... There is a standard. You can switch your implementation almost without pain.

Collapse
 
absinthetized profile image
Matteo Nunziati • Edited
  • Memory Hog.
  • Old programming approach due to backward compatibility: no null-safety, very verbose way to invoke lambdas (compare with trailing lambdas and so in Kotlin), stupid things requiring patches (Lombok), new features require time to be merged (map/reduce/filter), idiotic libs (BigDecimal, really?)
  • Everything is an object even if I do not want state management at all.
  • Ton of frameworks doing automagic things which require time to learn (Sprint/IoC in general, JPA, ...)
  • general overcomplex mindset in the community (all comes from the boring Java EE mindset, with few neglected good things: like Vert.x, micronaut-data-jdbc)
  • Only recently people with micronaut and quarkus (and IMB with OpenJ9) are trying to make java more feasible for modern computing trends (containers/serverless functions)
  • inevitable patch'n'go approach instead of redesign (GraalVM native compilation, to compete with lighter solutions)

Anyway there are also good things (TM), still you asked for cons only :P

Collapse
 
vepo profile image
Victor Osório

Regarding the Memory Hog...

Ok... you develop C/C++ with Qt! Nice, we have the same background. I developed C for years, start using Java, then starting porting C libraries using JNI.

I think the JVM Memory Management was a nice feature in the past, but Docker killed the necessity for this feature. If we could just delete an object manually will be a great improvement.

Collapse
 
absinthetized profile image
Matteo Nunziati • Edited

When people refer to java as a memory hog, they compare it to other more higher level alternatives then c/c++: Node, Python, Ruby, C# they all consume less memory than java in the same condition. Some do with perf handicaps (Python), still the used ram is way lower.

Also there is a "niche" now days with Go and Rust. Here the memory usage comparison is simply a joke!

About cap'ing memory usage, yes this was a good feature in the 90s but with VMs (way before containers) and a good "single responsibility" approach to ops, java memory cap'ing is obsolete IMHO - also java 8 had some nasty side effects with containerised envs.

Also, why limit max memory but not CPU usage?! you can still put a server on its knees just limiting max RAM! So the feature was nice but also non-complete.

Thread Thread
 
vepo profile image
Victor Osório

Thanks again, I didn't know the meaning of the word hog. 😏 So I had to assume based on Google Translator.

Collapse
 
vepo profile image
Victor Osório

Thanks! I agree with you.

About the tons of frameworks...

In truth, there is a political game from Pivotal that creates one framework besides the community.

In Java, the community is important and there is a standard for development. Jakarta EE, former Java EE, is the standard. If you implement your application using Jakarta EE you can deploy in any Application Server the implements it. I have already switched from one implementation to another with no changes on my code.

Now Spring is the most used Framework, but it is not a Java standard.

Collapse
 
absinthetized profile image
Matteo Nunziati

Yes, this is debatable: it is better to have a rather complex standard (Jakarta) once learned used everywhere, or a lot of simple frameworks? I mean: it took me 30 min to understand Vert.x Web, but a lot of CDI/IoC is still black magic to me! Let alone how the hell JPA can amazingly derive SQL queries from methods' manes! that's silly!

Collapse
 
spez profile image
Abhigyan

Just ditch Java, pray for Kotlin

Collapse
 
andy3520 profile image
andy3520

By an accident I'm turned into a Java(Spring) dev from being a Frontend JS guy. If I skip all the technical thing and only look into the process of learning, finding resource, researching, All I could says is:

  • Java doc is suck, sometimes just a bunch of class without told you what to use, how to make it work.
  • The lib sometimes good but cannot find a helpful example or document.
  • Any process is config hell.
  • Xml config suck (I love Json and yaml)
  • Have to spend to much of time and have many knowledge to understand a piece of code (pattern, annotation, ...).
  • The community is not active like JS.
  • To many coding syntax.
Collapse
 
13ththief profile image
Manpreet Krishan

Too verbose! I'm not experienced as others here but when I started it, the verbosity of it deterred me from it. Never looked back at it since.

Collapse
 
kovidr profile image
Kovid Rathee

Speaks more, does less. The opposite of Python.

Collapse
 
vepo profile image
Victor Osório

Are you sure?

What do you mean with less? Are you saying that Python is fast? Or are you saying that Python has more functionalities?

Collapse
 
kovidr profile image
Kovid Rathee

My experience has been that in most cases, you have to write more lines of code to get the same thing done. Didn't speak about which one's faster. They can coexist. In some situations Java is better, in some Python is better. And there're several other languages too that compete. There's no perfect language.

Collapse
 
wagslane profile image
Lane Wagner

Memory hog. Everything is an object.