Live data from Hacker News

Java 18 / JDK 18: General Availability

mail.openjdk.java.net

31–40 of 304 posts

Re: Java 18 / JDK 18: General Availability

#31

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.

Great tooling. Good performance. The JVM is very tunable. Huge ecosystem of libraries. Language wise modern Java is fine, but if not, there are other languages on the JVM that interop.

Re: Java 18 / JDK 18: General Availability

#32
post #13
post #6

Is there a reason to use Oracle's closed-source Java implementation instead of the opensource implementations? Asking as someone who's ignorant about Java. edit: per comments below, Oracle's Java is open-source too these days.

Licensing. Oracle requires a commercial license

That's a reason not to use Oracle--GP's asking for a reason to use Oracle.

Re: Java 18 / JDK 18: General Availability

#33
post #18

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 developers are cheap and easy to find. There are libraries for everything that you would need - AWS SDK, Redis, etc. Performance is tolerable and can be improved with things like Micronaut and native ahead of time compilation (GraalVM).

> Java developers are cheap and easy to find.

I wish.

Re: Java 18 / JDK 18: General Availability

#34
post #13
post #6

Is there a reason to use Oracle's closed-source Java implementation instead of the opensource implementations? Asking as someone who's ignorant about Java. edit: per comments below, Oracle's Java is open-source too these days.

Licensing. Oracle requires a commercial license

You can get a paid commercial support license for Oracle's JDK to get an extended maintenance window. But Oracle's publicly available builds don't require a paid license. However,they only provide public builds of the current Java version. If you want LTS, you have to pay them or use another vendors builds.

Re: Java 18 / JDK 18: General Availability

#35

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 values backwards compatibility very highly, so if something runs today, it's likely to keep running without modification on future JVMs. (Though the 8->9 transition was pretty rough for some.) Compiled Java artifacts are usually portable across OSes and CPU architectures, so your build pipeline can be pretty simple even if your infrastructure is not.

JVM performance is generally fine, and the language prevents you from introducing whole classes of memory safety bugs. You can still shoot yourself in the foot with native (JNI) extensions, but the decent performance of the JVM makes developers use JNI far less frequently than, say, Python or Ruby devs reach for compiled libraries.

JVM byte code decompilation is fairly trivial, so tools for the security scanning of artifacts are cheaper and more fully featured than similar tools for scanning machine code.

Re: Java 18 / JDK 18: General Availability

#36

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.

Because Java is engineered. You can imagine the amount of work going into it. You have multiple companies have whole teams working just on different garbage collection algorithms. No other dev stack has this kind of focus. The JVM is a small wonder. And Java is evolving quite nicely too.

Re: Java 18 / JDK 18: General Availability

#37
post #20

Earlier quoted context omitted.

Oracle's builds of Java are open source as well. The OpenJDK codebase is shared across all of the vendors that provide builds.

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

I do not know but apart from just vendor lock in, oracle might provide guarantees (maintenance?) that the other providers cannot.

Re: Java 18 / JDK 18: General Availability

#38
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 }

It is true that C# improved this. Separating primitives and references in Java was definitely an error and it cannot be fixed at this point.

The good news is that a linter trivially detects this bug.

Re: Java 18 / JDK 18: General Availability

#39
Still waiting for JNullType to be deleted or made illegal to inhabit all reference types.

"I call it my billion-dollar mistake. It was the invention of the null reference in 1965. At that time, I was designing the first comprehensive type system for references in an object oriented language (ALGOL W). My goal was to ensure that all use of references should be absolutely safe, with checking performed automatically by the compiler. But I couldn't resist the temptation to put in a null reference, simply because it was so easy to implement. This has led to innumerable errors, vulnerabilities, and system crashes, which have probably caused a billion dollars of pain and damage in the last forty years. In recent years, a number of program analysers like PREfix and PREfast in Microsoft have been used to check references, and give warnings if there is a risk they may be non-null. More recent programming languages like Spec# have introduced declarations for non-null references. This is the solution, which I rejected in 1965." -- Tony Hoare

Let's give credit to C# and Dart for fixing this, and bring shame to Java and Go for not doing so.

Re: Java 18 / JDK 18: General Availability

#40
post #22

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 language is simple. Reasonable performance, lots of opportunities to tune that performance without changing code. Great error handling. Works across all platforms in most cases. The tooling has a long standing reputation for being incredible, given what Eclipse and Jetbrains have done for the community. It integrates nicely with native code, and is easy enough to interface with (compared to e.g. Node.js and pytho…

Great error handling? What does that mean? Checked exceptions seem cool at first, but are really just nonsense… as your only real way of dealing with this is:

1. Catch, log and rethrow, or

2. Wrap as a runtime exception (so you don’t have to change every method signature up to main())

Sure, there’s option 3: catch and handle… but this is used 1/50 times, and the ergonomics of (2) overwhelm the utility of this.

BTW, vavr is nice. Just, “run it all” and optimize for the golden path. If there’s an error account for it locally.

Post reply on HN