Live data from Hacker News

Java 16

jdk.java.net

261–270 of 327 posts

Re: Java 16

#261

Happy with the number of comments on this release. HN is a funny place.One day you are convinced no smart person on HN is still writing Java and the next day you see droves discussing about a java release.

A new JVM release is always cause for cheer. The demo language it comes with also keeps getting better :-)

Re: Java 16

#262
post #226

Man, I hope the migration to Java 11 that my infrastructure team started 18 months ago is going okay.

Can't read whether this is sarcastic or tongue in cheek ;-) Java 11 is the newest LTS release. The next LTS release will be Java 17. Many companies won't touch anything that isn't LTS. There are still a large number of companies staying on Java 8 :shrug:

LTS doesn't exist within OpenJDK. LTS only exists if you're paying a specific provider for it.

Re: Java 16

#263

Do you think the "Run anywhere" marketing behind Java is rarely important? Java programs normally sit on a server, or many servers of the same arch. The decent thing is that someone can build a JVM for a new architecture and lots of /other/ languages that target the JVM work. But this seems different from "my program can runs on lots of architectures".

In the 1990s it looked very much as if desktop and server heterogeneity would be the norm. That you'd pick between alternatives like Solaris on SPARC, HP-UX on PA-RISC, Irix on MIPS, Windows on Alpha / MIPS / x86 / PowerPC, MacOS on PowerPC, OS/2 on PowerPC / x86 etc etc. The designers of Java, as well as software community at large, had dealt with the pain of moving large codebases across platforms and so the WORA p…

It would have been cool if Limbo/Dis would had gotten more attention at the time. To me it looks like a more promising base, and was released the same year as Java. I can't at the moment find under what terms it was released back then, but it's free software now.

Re: Java 16

#264
post #3

Why they decided to change the keyword rules to use "non-sealed" is beyond me. Surely, there might be other choices? Closed/unclosed? Unsealed?

Yes. It feels out-of-place. All other keywords are like one word: enum, class, public, protected, native, sealed, ... But looks entirely different: Two words, connected by a hyphen. But I think, it was done because of backwards compatibility. If they would have called it "closed", it would maybe break hundreds of programs that have methods/variables called "closed"

Surely migrating variables named "unsealed" would be fairly trivial?

Re: Java 16

#265
post #27

Earlier quoted context omitted.

We see similar developments with C# borrowing features from F#, with records in v9, pattern matching, etc. While it's good for C#/Java, it does make it harder to push for adoption for a language such as Scala and F#. Why bother investing in the languages with a much smaller market share when the big boys adopt good bits and pieces from them constantly?

I can only comment on C# / F#. The C# versions of F# features tend to be pretty clunky compared to the F# versions. This is because F# was designed for them from the beginning, rather than having them tacked on. Functional programming is getting easier in C#, no question about that, but honestly, it still kind of sucks. And the OOP-minded C# devs on your team still won't be able to make sense of your code that levera…

What fancy features won't we understand?

I think some things about functional programming make code feel cleaner, but I don't like it enough to use F# or Haskell.

Re: Java 16

#266
post #133

Earlier quoted context omitted.

I think it's interesting to discuss how many are stuck on java8. It was a long time many of us were stuck on java6 or 7, and finally got up to java8. But then when 9, 10 and 11 came no one made an effort to upgrade. Why? And now we're at 15 and people are starting to feel the heat. We only migrated our main service from 8 to 15 a month ago (AWS deprecation), but still have lots of 8 code laying around (luckily some o…

> I think it's interesting to discuss how many are stuck on java8. [...] But then when 9, 10 and 11 came no one made an effort to upgrade. Why? A lot of things broke in Java 9, which was short-lived (both it and Java 10 lasted only six months each), and then Java 11 broke many other things (for instance, it removed all of J2EE). As late as last year, I was still seeing changes in libraries to fix issues with Java 9 o…

In my experience mst of these changes are simple to add to your projects pom or build.gradle. For instance the removal of the jaxb xml runtime is a simple 1 liner to your project:

    runtimeOnly 'org.glassfish.jaxb:jaxb-runtime:2.3.2'

Re: Java 16

#267
post #156

Earlier quoted context omitted.

> Records (...) are borrowed from Scala. I think records already existed in FORTRAN and other languages like ALGOL-60. C has structs, too.

Yes you are right, records have been around for a long time. COBOL was a popular, very early language supporting hierarchical data of different types. This dates back to approximately 1960. FORTRAN didn’t have records other than I/O “records” (at least for the first 20 years). ALGOL-60 didn’t have records. Algol-68 did have records, however Algol-68 wasn’t in very widespread use. I never had an opportunity to use it;…

In the end... Pascal was/is hugely influential, and, yeah, it called these kinds of things "Records." But the funny thing is it's been so long since I wrote Pascal or Modula-2 that when I first heard the term "Record" in the context of Java I never made the connection.

Re: Java 16

#268
post #232

Earlier quoted context omitted.

Because while in the end project valhalla will not call them value classes, it is a sort of an overloaded term. Structs/value types can be mutable, records are not. They are basically tuples with names. And as far as I know, while records have a sane default equals defined, they are still identity objects in that they are passed by reference.

> Structs/value types can be mutable, records are not. Fair point about record fields not being reassignable (not the same as immutable for others reading this). > And as far as I know, while records have a sane default equals defined, they are still identity objects in that they are passed by reference. Well, sure. All non-primitives are passed by reference. That doesn't stop them from being referred to as value typ…

I stand corrected, shallowly immutable or as you note fields not being reassignable it is.

Re: Java 16

#269

Earlier quoted context omitted.

For a couple decades, x86 was absolutely dominant and there were no new architectures of any importance outside specific niches. Once you dealt with the OS specific oddities (which java also helped with), C++ was highly portable.

> For a couple decades, x86 was absolutely dominant On the desktop and servers, maybe. But there is more in heaven and embedded than is dreamt of in your philosophy.

I work in embedded. Embedded Java has always been a huge set of tradeoffs, which is why it never took off outside of application platforms like mobile phones and set-top boxes.

If you wanted the full fat SE Sun/Oracle JVM you were pretty much stuck with power or ARM, and even then you had to be careful. Remember the portability disaster that was symbian and Java ME? These ISAs weren't exactly the low end of the embedded market at the time either. The farther away from x86 you got the less portability you could actually take advantage of.

Re: Java 16

#270

Earlier quoted context omitted.

>Why bother investing in the languages with a much smaller market share when the big boys adopt good bits and pieces from them constantly? because if you know exactly what you want to do there's no reason to settle for the second best thing. If you want F#, no harm with going exactly with F#. I talked to a bunch of Jane Street engineers once and the consensus seemed to be that Ocaml, despite its very small footprint,…

> actually helped them attract the kind of people who were super enthusiastic about building really good stuff with a good technology, so it actually made recruiting for them easier. Sounds like a strong case of selection bias. There is no shortage of people who are super enthusiastic about building really good stuff with good technology, and it's hard to believe that it's easier to hire Ocaml engineers than other la…

I really don't want to sound elitist, but there is the issue that probably 90% of people who have ever written code for money know enough Java to get by and credibly claim they can do it on a resume. Just the ubiquity in university intro courses and enterprise use means everyone gets exposed to it.

On the other hand, if you see someone took the time to learn OCaml, I think you can be reasonably well assured they legitimately love programming. Signal value jumps from "this person has ever programmed" to "maybe this person has a real passion for it."

Post reply on HN