Hacker News new | ask | show | jobs
by yakubin 1859 days ago
I don't work with Java, but I can think of a few advantages off the top of my head:

- appreciation of backwards-compatibility (here it wins with Python);

- great debuggers and performance tools (e.g. Java Flight Recorder or Eclipse Memory Analyzer);

- easy deployment - you can just give someone a fat JAR (here it wins with all scripting languages, so Python, Ruby, PHP, or any other flavour of the month);

- industry-grade garbage collectors;

- publicly-available standard spec (here it wins with all the defined-by-implementation languages such as Python, PHP, Rust, basically most languages, and with languages which are standardized, but their specs aren't public: C, C++, Ruby);

- kind of like the previous point, but anyway: multiple implementations to choose from;

- I've been told it has good performance. I've never seen a real-world Java application which felt fast, but I've heard people put it at the pedestal and the Debian programming languages benchmarks game seems to corroborate that story;

Besides, the question wasn't about which technologies we like, but which we believe are entrenched so much, they aren't going to go away for a very long time. I don't see Java going away for another 100 years, no matter how much I would or wouldn't like to work with it.

4 comments

- Fantastic battle tested ecosystem of libraries. - Stable cross platform (kills Python, Node here). - Lingua franca.

Now I personally don't like Java - it feels crusty vs C# - but the libraries are amazing.

You can also use something nice like Kotlin and you have all of the platform benefits with non of the crusty language issues.

I started using java 16 after a long hiatus from java 7 (instead doing rust and clojure) - I'm pretty happy with some of the new language features - lambdas, records, type inference, streams
IMO the Java stdlib also strikes just the right balance between control and abstraction. You can write thread-safe, performant code that makes reasonable tradeoffs between data structures without worrying too much about the details about memory layout and allocation. Said code also is easy to debug even without a debugger because there's almost never undefined behavior caused by use-after-free type bugs and error messages are clear. And the tooling - just IDEs alone, never mind debuggers - is mature and effective.

After using Python, Go, PHP, and C++ it's easy to see why Java is the go-to language for server development.

It wouldn't need as much research into efficient GCs if it was possible to write efficient programs in it. e.g. everything has a lock word, there's no value types or fixed length arrays, you have to allocate boxed integers.
people complain about java's verbosity, but I see that as a feature in places where there's a revolving door of consultants working on things. Everything is so explicit it is easy to see what some code does.