r/linuxquestions • • Jun 12 '20

Resolved Why does everyone hate Java applications?

I see it generally everywhere I go as a Linux user: almost everyone has some kind of problem with Java applications. I understand Java as a development platform has some rather infuriating holes regarding its deployment methods, and the most common issue I've seen are memory leaks and just how memory hungry the applications can be by themselves.

Is it a concept of purity? Or is is just because of some other reason that seems to escape me? I use some Java applications almost daily without problems. So why the grudge?

Opinions, rather than absolute answers, are expected.

Resolved -- Technically, there have been several wonderful and informative answers here on this post. Some answer the question better than others. However, not one singular answer is fitting enough to answer this question, so I thank everyone who took the time out of their day to enlighten me about Java and its rather unfortunate history. Thanks again!

128 Upvotes

137 comments sorted by

View all comments

3

u/pykypyky Jun 12 '20

When we are taking about Java, there's language, there's runtime, and there's ecosystem.

Java as a language is not horrible, but it's a dinosaur. A lot of things were not thought through in it. When you programmed in c#, going into Java feels like an endless wtf. I guess as a programmer, I got spoiled by c# and .net in general.

Runtime has similar problems. It's sort of kind of .net, but it has been written during stone age, and a lot of things feel idiotic. For example, when you start Java program, you must tell runtime how much memory you give it. And it would allocate all of it, and won't use more than that. Personally I am used to process taking only as much ram as it needs, and asking OS for more if it needs more. That's just one example of wtf, there's many many more

Ecosystem as one would imagine is vast, but not every package is too notch. This is not necessarily problem unique to Java, but being one of the oldest, it is one of more notorious. It's next to impossible to avoid using some shit library which would bring up security hole

And to top it off, the language has very few good options for IDE. And you must have IDE when you write Java programs if you want to be efficient, because language intellisence is the only way to write code and not kill yourself. Again, coming from .net world, the choices you have are not good.

Tl,Dr: Java is a mess

1

u/yaaaaayPancakes Jun 12 '20

I came from the .NET world, and for the most part, I agree with you. But I have thoughts on some of you points:

Java as a language is not horrible, but it's a dinosaur. When you programmed in c#, going into Java feels like an endless wtf.

Having been in it exclusively for 5 years, the lack of reified generics is the biggest WTF of all. Thankfully, Kotlin kinda sorta adds the ability to have reified generics, but it's still a kludge since the runtime doesn't support them and it never will, since Java decided that binary backwards compatibility was a requirement (MS chose to break compatibility between .NET 1.1 and 2.0, which added generics).

For example, when you start Java program, you must tell runtime how much memory you give it. And it would allocate all of it, and won't use more than that.

This is only partially true. I was just actually playing with those options yesterday, as I tweak our Gradle builds to not OOM in CI/CD.

There is basically a starting and a max option. If you set both to the same value, then you get the behavior you describe. If you set the starting memory lower, it will ask the OS for more as needed until it hits the max value.

Early versions of the JVM had kinda stupid defaults, but current versions aren't as stupid and usually, you don't have to mess with it (unless your devops team does something like set the containers max memory to 1GB in k8s).

the language has very few good options for IDE

At this point, unless MS has made major updates to VS (last version I used heavily was 2013) I would argue IntelliJ is at about the same level of polish.

Eclipse is still utter trash, and I'm still so thankful that daddy Google forked IntelliJ to create Android Studio, and yeeted the Eclipse Android Development Tools into the Sun.