Live data from Hacker News

Java 18 / JDK 18: General Availability

mail.openjdk.java.net

71–80 of 304 posts

Re: Java 18 / JDK 18: General Availability

#71

This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.

Java is easy to understand and it's hard to shoot yourself in the foot with (no raw memory access, unless you use JNI/JNA). Garbage collector makes memory management a non-issue. Exceptions make error handling easy. OOP is a simple concept and many real-world programming tasks can be laid out as a nice class hierarchy. Java's changes are few (as opposed to some other languages), feel logical (to me at least), and solve real problems. Most of "syntactic sugar" features don't make the code using them less readable.

Java also supposedly runs on everything. And, you could as well write Android apps in it.

Re: Java 18 / JDK 18: General Availability

#72
post #49
post #44

Earlier quoted context omitted.

Was referring more to structured stack traces. You're able to shoot yourself in the foot in any language's error handling system - quite trivially at that.

But the problem is that checked exceptions create the same “what color is your function” problem for errors.

>But the problem is that checked exceptions create the same “what color is your function” problem for errors.

Compared to "SEGFAULT at 0x000000 in some xxx.dll" having to handle exception and having readable stack traces is a productivity win.

Re: Java 18 / JDK 18: General Availability

#73
post #16
post #8

Earlier quoted context omitted.

I'll try: Java is a proven, boring and "easy" language without much surprise, with a big standard library and ecosystem.

Java is great, but here's a surprise: if (str1 == str2) { // oops }

Really? You are only "confused" by this if you are very new to programming in general.

Re: Java 18 / JDK 18: General Availability

#74

This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.

To echo others: relatively good performance, incredible tooling/deployment infra (really best-in-class), intercompatibility with tons of other languages built on top of the JVM such that it can be functional/do actors/whatever your other weird approach is, relatively high productivity due to a large library base (not just the standard library but also a huge amount of stuff written to support android apps), and ease of hiring/replacement.

But to throw another onto the pile, Java being statically compiled makes it a lot easier to comprehend a larger codebase that you didn't necessarily write yourself. The history of dynamically-typed languages is basically getting to a certain critical size and realizing there's some merit to a well-defined, compiler-checkable code interface and then retconning it in - this happened with Facebook (Hack-lang), with Typescript/CoffeeScript (Google), and I think there's one for Python now too.

So yeah, basically people like Java because it's fast and versatile, because it's got a Pythonesque amount of stuff already written for it, and because it's got features that are oriented towards bigger teams with more turnover/etc that make it practical for business reasons.

Re: Java 18 / JDK 18: General Availability

#75

This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.

Tooling, performance, observability, and maintainability.

Re: Java 18 / JDK 18: General Availability

#76
post #42
post #20

Earlier quoted context omitted.

Thanks! So why would I pick Oracle's implementation?

If you need to run Oracle apps like EBS. They only work on their release, not openjdk. Side note: Avoid EBS at all costs if you can, unless you like spending money on consultants and like crappy obfuscated processes.

> Avoid EBS at all costs if you can, unless you like spending money on consultants and like crappy obfuscated processes.

* Oracle products in general (in my experience)

Re: Java 18 / JDK 18: General Availability

#77

This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.

This is an interesting question. Not because of Java (that is answered) but because of the alternatives. Kotlin/Scala/C#/F# are the same stack types, C/C++/Rust are lower level, leaving it realistically (job market) to Python, JavaScript and Go. Python and JavaScript are quickly sorted out as non static typed and Go is still not in the league of Java or .NET despite all it's amaziness.

So it boils down to: do the people like static typing or not.

Re: Java 18 / JDK 18: General Availability

#78

This is tangential and possibly too open ended to be productive but worth a shot anyway. Why is Java so popular? I know of a major Silicon Valley company that's migrating their backend to it. Why Java over other languages? Or maybe there's not really other viable options? I'm speaking as someone who spent the last 6 years focused on frontend web technology.

The JVM is great. It's easy(-ish) to deploy and there is a library for anything you can possibly think of, probably more than one, on Maven. It handles large throughput and big memory usage very well and is extremely tunable. Using the JVM doesn't mean you're limited to Java anymore, and hasn't for a long time. I have built software for the JVM for the past 6+ years nearly exclusively in Clojure with only a few momen…

Can confirm. Been learning Clojure lately (after using Python for a long time) and it's great. That being said, the JVM is a bit chunky in terms of disk usage and when you get into really high performance things, tuning heap space and whatnot is a pain (I'm looking at you ElasticSearch), but it really is a fantastic piece of engineering.

Re: Java 18 / JDK 18: General Availability

#80
post #19

Earlier quoted context omitted.

"Open Source" but not free to use as you wish. The Oracle builds require a commercial license.

In this case it means GPL+Classpath Exception. The link goes to the Oracle provided OpenJDK builds. Oracle also has their own build of the JDK which is not GPL. That is free to use in commercial software as well, under their "No-Fee Terms and Conditions"

I think you're correct right now, but Oracle has a tendency to change their minds frequently. Tomorrow you might be migrating or paying.
Post reply on HN