Live data from Hacker News

Java 18 / JDK 18: General Availability

mail.openjdk.java.net

101–110 of 304 posts

Re: Java 18 / JDK 18: General Availability

#101
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.

For some purposes a tested validated binary may be appropriate vs mystery meat someone threw through a compiler then shipped without testing.

[deleted]

Re: Java 18 / JDK 18: General Availability

#102
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.

No one really uses checked exceptions. But I agree they suck, IOException is the bane of my existence. It's the #1 reason why I don't like Rust or Go. Checking errors is dreadful.

Re: Java 18 / JDK 18: General Availability

#103
post #96
post #40

Earlier quoted context omitted.

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, v…

Anyone not seriously considering option 3 as the default, with options 1 and 2 being the exception that one must have good reason to take, automatically disqualifies himself as ignorant of proper error handling. Of course you catch and handle errors. Or at the very least you must think about whether it makes sense to handle an error on the current abstraction level that you are on, which means you must always conside…

By your opinion 90%+ of Java ecosystem is ignorant of proper error handling, which in itself is a statement on how poorly this method of error handling is looked at.

Re: Java 18 / JDK 18: General Availability

#104
post #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 y…

> Java values backwards compatibility very highly, so if something runs today, it's likely to keep running without modification on future JVMs.

Then why do I have to have multiple JVMs installed, which I need to go through via trial-and-error, if I'm given some random java application?

Re: Java 18 / JDK 18: General Availability

#105
>JEP400: UTF-8 by Default

This changes the default charset of the Java APIs to UTF-8.

I read that the Java 8's JVM's internal string representation is UTF-16 [0][1]. Is that still the case after JEP400?

[0] https://docs.oracle.com/javase/8/docs/technotes/guides/intl/...

[1] http://tutorials.jenkov.com/java/strings.html

Re: Java 18 / JDK 18: General Availability

#106

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.

JVM echo system / tools / libraries / performance is awesome. Frameworks like Spring/Spring Boot have made JVM the default choice for many big tech. It is a no brainer and it works. No one will ever get fired for choosing Spring Boot for a new project :)

Re: Java 18 / JDK 18: General Availability

#107
post #18

Earlier quoted context omitted.

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).

They're not cheap :) or -- I'm not sure what you mean by cheap, but good Java coders are generally amongst the best paid ones.

Good coders are generally amongst the best paid ones, but let's be honest an average Java developer is lost if they can't find an annotation to solve their problem. It was the "default mid-tier university language" for a while, and it really shows in quality of people who apply.

Re: Java 18 / JDK 18: General Availability

#108
post #79
post #61

Meanwhile, still using Java 8 at work

I see this everywhere. What's the excuse in your case?

A Spring Boot project with a good number of dependencies, the bleeding edge Spring Boot supports newer Java, but then you need to worry about Hibernate's compatibility with the latest Spring Boot, etc.

I think at least some of my dependencies still rely on reflection features that are limited by Java 9.

Not OP by the way

Re: Java 18 / JDK 18: General Availability

#109
post #79
post #61

Meanwhile, still using Java 8 at work

I see this everywhere. What's the excuse in your case?

I think for most people it's the introduction of the module system. If it causes code to break in libraries you're using and there's no direct replacement for those libraries, it's a big hill to get over.

Re: Java 18 / JDK 18: General Availability

#110

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.

IMHO, Marketing. Java had so many marketing crazes that it's crazy. I still remember the "Java mobile game" fad from a dozen of years ago - Java this, Java that, Java for phone, Java for toaster... At some point, the public mind starts to associate "programming" with Java. Since there were (and probably always will be, unless we evolve into utopia) hordes of job-desperate people who would do anything to feed themselv…

I see this post is getting some downvotes; I'm not sure I agree with all of it myself. But I would ask those, who reject the premise here outright, to think back really hard to how things were in the 1990s. The Java brand was everywhere. It was a truly massive endeavour and one of the first languages to really go "viral" as the Solution For Everything.

People laugh at the cute "Java runs on four billion devices!" tagline but back in 1995 if you weren't doing Java, you were a last-century coder. It was so pervasive Brendan Eich even renamed his strange scheme-smalltalk mashup "JavaScript".

Post reply on HN