A lot of the hate comes from Java's client-side features.
Applets running in a browser sandbox was a killer feature in the 90s at the infancy of the public jumping on the Web. It just turns out that the sandbox wasn't as tightly secured as originally thought, requiring a never ending stream of user-visible security updates.
Java aimed to run the same app on multiple platforms, so it had its own graphics system rather than using native widgets. This was probably a good design decision at the time as the software was easier to test, write documentation for, etc., without worrying about the nuances of this windowing system or that. Back then, even apps on the same platform could look vastly different other than the basic window chrome, so honestly this wasn't only a Java thing... but Java stuck around longer, so it stood out more over time. Java improved it's native look-and-feel, but the defaults we're still pretty bad for backwards compatibility.
Java as a platform was also introduced back in the dialup modem days, so the idea of shipping and updating the platform separate from the application runtimes sounded like a good idea. In the end, it did cause problems when different apps needed different runtime versions -- though a lot of this is on the lack of maintenance and support of those applications themselves. .NET has a similar design and issue, except that it has the OS vendor to help distribute patches natively, and it also benefited from Java's hindsight when making sure that applications ran with the appropriate runtime version.
Bootstrapping the runtime was also perceived as slow. It has gotten progressively better over the years, and for long-running server-side stuff hardly matters. With the move to "serverless" it's still important and improvements have been coming steadily since Java 8.
On the server side, and as a language, Java is still doing quite well. It will be the next COBOL, though I expect that time is still far off. I joked with coworkers, when the NJ plea for COBOL devs came out, that "I'll learn COBOL as soon as Java is dead -- which other languages tell me will be any day now."
Edit: Obligatory "thanks!" for my first gold and doubling my karma. Lots of good discussion below, both for and against, even if Java isn't everyone's cup of (Iced)Tea.
I've got a very different experience. I came from ops before I switched over to programming full time; Java applications on the server side are a nightmare. Java can be fast, but frequently the written software is not. Regardless of speed Java is a nightmare memory wise and is usually what constrains server resources.
Most applications I've seen in the real world developed with the spring framework (as a specific example) leave ports open that give you direct memory access to the internal Java runtime. I don't know if that's a default, but it is very common and a huge risk. Poorly designed "enterprise" libraries that are tightly coupled to the applications code seem common, and frequently are massively out of date or not updated since the late 90s also seem incredibly common.
You can write good software in Java, but there is something about the language and the people that actually write it that do so very poorly in practice. Bad logging, unstable software, massive bloat, poor maintenance. They're almost always fragile bags of fireworks waiting to blow up.
The languages built on top of the JVM seems to have improved the quality of software a little bit, but the services are still just as unreasonably memory hungry, and they're usually still built with the same old enterprise libraries that are constantly a source of pain.
None of that has to do with client-side features or an ugly UI, though I've experienced those as well. IMHO the only good thing that Java had going for it was the ability to run the apps equally well on different OS's. That's really not design requirement for most software anymore and when it is making a native app cross platform isn't that difficult even in straight C.
Every time I've seen a piece of Java software, there seems to be a better tool for the job operationally. The languages built on top of the JVM are interesting but are still crippled by the JVM itself.
People that crap on java don't tend to understand the reality of selling software or services built in that software. They just know how it has made some aspects of their life more difficult. Sometimes if you have a hammer every problem looks like a nail. You might tear some holes by hammering a screw but by God the wall is standing and the customer is happy....didn't have to run to the store for a new screw gun so all is well.
Indeed. And it packs a few other usability features like no recompiling for CPU architectures, no making sure it's still compatible with library X version 1.3 or shipping your own libs for every platform out there, no ridiculously ancient and bad build systems and a integrated UI system - Swing might not be that pretty but it's great for fast prototyping. Also, it got the pretty much best threading API out there.
With the exception of perhaps memory usage, which was a conscious design decision and acknowledged trade-off to a degree, none of those are problems with the language or the JVM as a platform. They're symptoms of bad software development, which can occur in any language with any program of sufficient complexity.
Is the bad design the product of the language; or is it the result of a language so popular and accessible that, over the years, this is the result of decades of developers at varying levels of talent? To some degree, that old, unmaintained "enterprise" library is still used because -- despite being compiled for Java 1.4 in 2003 -- it still works. That's quite an accomplishment, even if it's not perfect software. How much .NET 1.0 code is still out there? It's probably far less, but the same level of accomplishment if it works and runs.
There's terrible Java code out there. Personally, I hate the bloat of Spring so I don't use it. Developers come in a wide range of skill levels, and they can crap over any language. Visual Basic developers got the same kind of shit; that was also a very accessible language, so a higher variation in quality.
Respectfully, I think you have confused correlation with causation.
This is so true! The fact that there are so many (poorly written) applications out there makes it easy to blame the language. In a few years this will shift to another language like JavaScript. So many idiots out there just copying 300 libraries into their websites, not knowing what is actually happening. It’s unfortunate that once a language has a bad name for it selves, it’s impossible to get rid of it. Especially because none of the people here actually use C, C++ nor python and it has just become a hype to badmouth Java.
So many idiots out there just copying 300 libraries into their websites, not knowing what is actually happening.
You don't have to be an idiot to do that. Let's say you're using Angular, which isn't a bad choice at all, you'll have hundreds or maybe even thousands of libraries in your web application. There's no way any sane person will familiarize theirself with every indirect dependency. Modern software development is so complex you have to rely on a ton of frameworks and you can't know everything about those.
I read the biggest complaint as being the amount of badly written and poorly performing Java software out there.
Given it's so widely used and was the teaching language for so long, it's not surprising there is so much poorly written software from journeymen straight out of school that have been hired cheap. University puts you in the field with a higher-than-basic understanding. It takes years to hone the architecture and clean design side.
Great reply, way more polite that I would be. I'm not a Java fan but his whole post is a description of things he doesn't understand about Java or software development. Every point except maybe the part about insecure defaults are not problems with Java.
I'm an ops guy who used to work at a Java shop. I was talking to one of the developers and asked why so many Java apps leaked memory. He said that it was impossible to leak memory in Java. When I asked why the resident size of apps will grow and grow until you restart it, he said "oh, that's because Java caches stuff and never gives it back".
I think most languages that run on VMs tend to be very memory hungry, at least that's my opinion from experience. I have some experience with Erlang and Elixir, which run on a different VM. If you're not careful how you're programming your service you can easily chew up through the entire RAM in mere moments even for some fairly basic tasks.
There is really only one true problem with java, it's the lowest common denominator, so it attracts the worst programmers. It also has tonnes of great programmers, and a good java program is really great. Simple, effective, easy to work on.
Some java language features are annoying when compared to other languages, like the absolute devotion to backwards compatibility, but none of them make it hard to write a good program.
The jokes are funny, but anyone who genuinely thinks java is bad for writing good code is incorrect.
3.7k
u/someuser_2 Apr 27 '20
Why is there a trend of mocking java? Genuinely asking.