4 ms·
I'm not sure I understand the comparison to Rust. The JVM is a virtual machine, analogous to the LLVM virtual machine that Rust targets. But that aside, I don't
by pron 4y ago
I'm not sure I understand the comparison to Rust. The JVM is a virtual machine, analogous to the LLVM virtual machine that Rust targets. But that aside, I don't agree with the sentiment. Rust and C++ are languages that emphasise full low-level control. As such they offer different constructs the programmer chooses from for different characteristics -- e.g. virtual vs static dispatch -- in cases that are abstracted into a single abstraction in the JVM which then relies on the JIT compiler to profile the execution and pick the best implementation (virtual or static dispatch). Java, therefore, aims for a balance between ease of use and performance -- with an emphasis on _amortised_ performance -- whereas C++/Rust aim for maximum control with an emphasis on the worst case.
As for the hatred to Java, some of it is due to experience with "old Java" which is then negatively compared to some "new X" (rather than comparing "new X" to "new Java"). Some just comes from popularity. In 20222 Java is the dominant server-side language, with no other language coming remotely close in that domain. In 2002 Java was also the most popular server-side language. Very few languages have ever achieved such success for such a long time (e.g. COBOL and PHP never did), and I believe the list includes just C, Java, JavaScript, and, to a lesser extent, Python. Of those four, only C, Java, and JavaScript are commonly/mostly used in large projects, and people often hate large codebases. Those three languages receive roughly equal amounts of hate. C++, which isn't as popular but is also mostly used in large projects, also receives a lot of hate.
I think people believe that some language X easily fixes some flaw they see in Java, but so far it's come at the cost of other shortcomings they don't see, which explains why X never becomes as popular -- which makes those people disappointed -- which, in turn, means that it rarely has big, old codebases, and so is never hated but just fades to remain fondly-remembered, or lingers as a niche language (although sometimes a not very small niche). This is somewhat like the Betamax vs. VHS debate. A relatively small group of ardent fans liked Betamax because it was superior in a metric they cared about, but was inferior in metrics other people -- a larger group than the first -- cared about.
In short, I think it's a combination of unfamiliarity with "new Java", the language's extended popularity, and its use in large codebases.
- pjmlp 4y agoForgetting about .NET?
- pron 4y agoNo, but it's hard to define what .NET is, because while there has been something called .NET for 20 years, it hasn't quite been the same thing. Is .NET now (.NET Core) the same platform as .NET of 2005? Also .NET is not as popular, and its adoption is also a little weird. It's quite popular overall, but doesn't dominate any domain. It's used on the server but not nearly as much as Java; it's used on the client, but not nearly as much as JavaScript. I think it's still largely confined to Microsoft shops. So both in longevity and popularity it's not quite in the same class as those others.
- pjmlp 4y agoJava surely hasn't taken any bite out of .NET desktop development, or the game industry, with exception of Minecraft. Regarding defining what Java is, what about Android Java, real time Java, Java on mainframes, forks like microEJ, Graal, OpenJ9, Azul.... Just as hard to define.
- pron 4y agoI never said Java took a share of .NET's desktop, but the dominant client-side platform these days is neither Java nor .NET. And by Java I mean the 27-year-old Java SE specification (real-time Java makes up for a negligible portion of Java's market share, and while JavaCard is incredibly popular, I count it separately).
- pjmlp 4y agoYou're right, it is Android Java, which isn't Oracle's Java. On a .NET/Java shop and we have like 50% of both stacks in every, single, project. Nowadays I tend to spend most of my time on the .NET side, because I get to enjoy Valhalla, Vectors, async/await, TPL, since years now, instead of waiting for what might never come. I get to be on both sides of the coin, which would be advisable to the Java team to better know the competition.
- pron 4y ago