Live data from Hacker News

Java Is Underhyped

jackson.sh

181–190 of 808 posts

Re: Java Is Underhyped

#181
post #121

Earlier quoted context omitted.

Python is generally less performant. Go has a smaller ecosystem. IMHO, YMMV etc.

Yes, but that's my point. If I don't need performance, Python is ok. If I do, I won't go Java, I will choose something that is built for performance. Python is good enough for 99% of my performances need. The last 1%, jumping to java is not a big difference, I'll use rust or go. I won't use go for the ecosystem, but it's unique characteristics: easy concurrency, dead simple binary production. Java can't beat that. IF…

> Python is good enough for 99% of my performances need. The last 1%, jumping to java is not a big difference, I'll use rust or go.

Whilst I roughly agree, that's still a bit too simplistic.

In particular, we might prefer something like Rust to write a performance-critical algorithm, but that forces us to make a decision:

- Do we stick with Rust for everything else (networking, data plumbing, etc.)? This forces us to confront the ecosystem problem.

- Do we wrap our algorithm as a library for other languages (like Python)? This forces us to confront interoperability (ABIs, FFIs, cross-language dependency management, etc.).

There's lots of room in between these extremes for other pareto-optima, like Java.

Also, we often need to consider latency and throughput separately, rather than just "performance". Java is a pretty stark example, since it's pretty slow to start but reasonably fast when left running (compared to native binaries like Rust, which are low latency and high throughput, or scripting languages like Python which are high latency and low throughput).

Re: Java Is Underhyped

#182
post #164

Earlier quoted context omitted.

> But so it Python. For a very different definition of "good enough," i.e. unless you're working on a large codebase maintained by a large team for years, need high performance, or need deep low-overhead observability. So Java is "good enough" for a much wider selection of "serious" (large/mission-critical/long-lived/ high-performance) software. > And for specialized things, there are better choices available to me.…

Dropbox, instagram, google and youtube all were written in Python at some point. Languages don't scale, architectures do. But even when the language became the bottleneck, they went the road of rust and go, not the road of java. Again, not to say Java is not used by those companies with great success.

I bet it has more to do with their HQ location and feeling trendy than anything else.

Re: Java Is Underhyped

#183
I think Rust also meets all the criteria the author lists, probably Kotlin too, and arguably even Typescript (the quality package manager is a bit of a stretch, but I suspect the nominal typing the author hankers after can be emulated well enough to do the trick e.g. https://www.typescriptlang.org/play#example/nominal-typing). As to the reasons Java lost its hype: Enterprise baggage and Oracle; the terrible startup times and long GC pauses probably also didn't help (even if there has been a lot of progress in this area in recent times).

Re: Java Is Underhyped

#184

Earlier quoted context omitted.

Java is orders of magnitude faster than Python for code that doesn't spend all of its time waiting for IO. Java perf and Go perf are about the same.

But not Rust. And Go is better if you do I/O. That's my points. Compromises. I'm not saying "Java is bad". I'm saying, "I have no use case where I, personally, would use Java over something else." I do know other people have use cases for it. I just don't, because those compromises don't make sense for me.

Where is Rust AWT? Not to mention Swing, JavaFX, or even an whole mobile ecosystem.

Re: Java Is Underhyped

#185
The reason Java is so disliked is because new developers first contact with it is maintenance programming on the horrible J2EE/Spring monstrosity that has evolved since 2005, or from even earlier.

Re: Java Is Underhyped

#186

For my use cases, Java has all the wrong compromises: - not high level enough to compete with Python/Ruby/JS/PHP, etc - not low level enough to compete with Rust/D/Nim/Zig - not specialized enough to compete with Erlang/R/Go/Julia - not opinionated enough to compete with Lisp/Haskell So why use Java ? It's good, it's fast, it's productive, it's well supported, battle tested and documented for decades with a huge pool…

Kotlin solves most of the problems for us while leveraging the benefits of the JVM.

Long term, Kotlin will only stay relevant on Android.

They cannot fully embrace the JVM while targeting ART, JS and native at the same time.

Re: Java Is Underhyped

#187
post #124

The amount of vitriol Java receives in the game development space is rather strong. However, whenever people dismiss Java as being a bad language, I can't help but think of Minecraft. Yes, it's one of the few mainstream titles where Java has been successfully applied, but I believe Minecraft's success was specifically because it was written in Java. With no JVM, there would have been no Minecraft mods at the level of…

> For the people who say that Minecraft should have been written in C++ […] there's Bedrock Edition. Nobody I know cares about it enough to play it. Been playing for just under ten years, everyone I know plays Bedrock these days. I built and manage a very popular tool / Minecraft community and while I don’t have actual numbers, my general sense is the majority of players run either console or mobile Minecraft - all o…

It's probably worth noting that Minecraft has an incredibly lackadaisical approach to Java and Java upgrades in general. They're still on Java 8 and thinking maybe about upgrading to Java 11 at some point, although the performance benefits of going to the latest versions are really quite enormous in almost any benchmark.

There's an additional problem: when Notch first wrote it, he had some experience of doing games on the JVM and wrote the code in a performance sensitive style. But it wasn't a fully OOP style that people associate with clean, well designed codebases, so when Notch moved on, they immediately went and introduced tons of tiny classes for things like points or vectors where the prior code simply passed the components as parameters. That trashed performance. Again, newer JVMs are better at gobbling this stuff up, but it didn't help. Valhalla will eventually remove this tradeoff.

At any rate, Minecraft is a very good example of why more people should target the JVM for video games: modding is real, it can create communities that propel your game further than ever. It's not a great example of how to get the best possible game performance from the JVM. At all.

Re: Java Is Underhyped

#188
post #174

It's not perfect for anything but it's very robust and dependable. The API's are comprehensive, well thought through, to this day it's bizarre nobody has copied Javadoc. Python docs drive me mad. For a script - Python. For the web Typescript. For low level C or Rust. But Java is quite powerful for anything that stretches in between: not the fastest to write, but generally fast, the tooling is robust, the performance…

> to this day it's bizarre nobody has copied Javadoc.

JavaDoc-style structured documentation in comments with toolchain to generate user docs from a combination of the comments and the associated class/method/function signatures has been widely applied; Doxygen and JSDoc obviously owe a lot to it, as do Sandcastle (for .NET), Rdoc/YARD for Ruby, Sphinx/autodoc (for Python), etc.

I’d be surprised if there is a major language today for whuch there isn’t at least one JavaDoc-inspired documentation generator.

Re: Java Is Underhyped

#189
I feel like the arguments would've been better applied to kotlin (especially with IntelliJ). Java has two big problems: Null and boilerplate code (getters, setters etc.) which messes with code coverage (and no, lombok is no appropriate solution to this). Kotlin is pretty null safe and has very little things which we cannot properly test. The language is easy to learn and fun to write. It feels sleek, modern and you need to write less code than compared to java. You still get the whole ecosystem and can even migrate file-by-file. We actually still have a mixed codebase with 30% java and 70% kotlin (rough estimate) and it works wonderfully.

Re: Java Is Underhyped

#190
I think the author is still forming their opinion on those languages. Several of their points sound wrong.

"Dependency heavy workloads and industry trends"

The author complains about JS having small packages about trivial things (and for some reason when people talk about this they always mention lpad, apparently lpad is the only small package in NPM /s).

And about the fact Java has a type system. Many languages have a type system. In fact JS also has a type system through TypeScript.

"Nominal typing"

TypeScript typeguards are compared with the lack of Java typeguards.

- Java has typeguards and they're even being extended: https://openjdk.java.net/jeps/394

- Type guards have nothing to do with nominal vs. structural typing. They're rather used to disambiguate unions. If you have no unions you need no type guards.

- Interfaces in TS are structural, but classes are nominal. Typeguards can be either.

"Removal of responsibility for optimization"

The author believes Java frees them from memory management and multithreading race conditions, and the need to optimize (like think about underlying data structures, algorithms etc.).

Java reduces memory management concern relative to C++, but you still have reference leaks, you still need to free resources like file handles, connections etc. Also Java is no different than JS, C#, Python, etc. in that regard.

Java DOES NOT prevent race conditions.

Java DOES NOT mean you don't have to optimize.

-------------

All in all this reads a bit like a JS developer who just discovered Java and is excited. That's good, but my conclusion is Java isn't underhyped. Or overhyped. It's hyped just about as much as it needs to be.

Post reply on HN