Live data from Hacker News

A categorized list of all Java and JVM features since JDK 8 to 16

advancedweb.hu

111–120 of 243 posts

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#111
post #41

Earlier quoted context omitted.

> More seriously, what are you missing in Go that is well-done in Java? 1. Generics. And yea, I know Go is getting generics "Real Soon Now" (tm), but it is incredibly annoying to write the same collection code over and over and there's some third-party libs that would really benefit from generics (looking at you Azure Go SDK). 2. Error handling... with the big caveat that I actually like Go's error handling mechanism…

> I'm honestly never quite sure what people mean by "verbosity" in Java. Java improved with "var" keyword (use with caution!) and introduction of records. These are not the only code-shortening features (there are e.g. interface methods, diamond operator, lambdas, convenience "of(...)" methods, even "fluid style"), but they, used well, can really reduce verbosity.

I'm surprised you didn't mention the Streams API.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#112
post #70

Earlier quoted context omitted.

Same goes for Scala, where those Kotlin features come form originally.

Those features (except for nullability types) predate Java, let alone Scala and Kotlin, by a couple of decades. Those three -- like all programming languages -- get inspiration from similar sources. Java is just the most conservative of the three with regards to language features.

I think it's disingenuous to deflect by saying that Scala didn't invent those concepts.

I think it's pretty clearly significant that Scala and Kotlin are JVM languages, specifically.

If we just said "Well, StandardML had XYZ feature 30 years ago," you could reasonably wonder whether implementing those features on the JVM was a legitimate hurdle to not including them.

But the fact that the guy who wrote generics for Java then went and created Scala with these features is telling.

I also don't think that "Java is conservative" is the correct description of what's going on here. Look at the OP (I know you're a Java guy, so I don't mean that literally)- Java used to get maybe one language change for each major version until 16 where it got a bunch.

Why? I don't know. But I think it's totally fair to observe two correlations in recent history:

1. Oracle obtained control of Java

2. Many other, very good, programming languages have been coming on the scene: Swift, Go, Rust, Kotlin, TypeScript, C#, F#. Even older programming languages have seen major advances in the last 5-10 years: C++ and PHP among them. I think it's pretty clear that Java just didn't feel the pressure to make itself better until recently.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#113
post #93
post #84

Earlier quoted context omitted.

"Go is one of the HN darling languages" It's def not the case, I spend too much time here and on Reddit and people are always complaining about Go ( generics, errors, type system etc ... ), if you want the godly language it would be Rust, anything about Rust will be upvoted. As for Java, it's a good language / runtime that is overly complicated behind layers of abstraction. Take Spring for examnple, magic everywhere,…

The hype around Rust is largely justified. There. I said it. Rust is nowhere near perfect. It's also supposed to be a systems language- it was probably not originally intended to replace languages like Java for general "app" development. But it's so much better of a language than most of the higher level languages you see in popular use: Java, PHP, JavaScript, Python, etc, that people are actually willing to deal wit…

It surprises me that we don’t yet have an applications language with an ultra-modern type-system. It’s so strange that the current leaders are a scripting-transpiler (TypeScript) and a systems language (Rust) - but not an apps language in-between.

...then again it’s understandable when you see how the traditional apps languages (C#, Java, etc) are severely hobbled by their VM/runtime, because that’s usually the source of constraints on their type-system. Kotlin and F# do some neat tricks to work-around the limitations they inherited from the JVM and the .NET CLR respectively, but I think we’ve reached the limits of what platforms originally designed ~25 years ago can reach. I just don’t see the JVM nor the CLR getting anything like first-class support for higher-kinded types or true algebraic types: there’s too much pressure from establishment banks and insurance companies not to break their decades-old codebases maintained by outsourcing companies. Languages like Swift and Go are free to break their own molds because they’re happy not leaving a legacy, but what will that mean for Rust? Systems code is the last place you need major breaking changes, but I don’t see Rust’s progress slowing down the way ISO C++ languished for almost 20 years. Hmmm.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#114
post #56

Is it in the realm of possibilities that Java will someday have runtime generics support (instead of type erasure)? It's the most frustrating aspect of the language because you can't use basic Java features like method overloading with them. Also, I don't understand how people use the `Optional `..? Is there a way to use method overloading with it? `ErasedType` could be _anything_ at runtime, doesn't sound fun. Besid…

I believe refied generics are being worked as part of project Valhalla. Here's a related JEP which I could find. http://openjdk.java.net/jeps/218

From that JEP: "It is not a goal of this effort to produce fully reified generics."

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#115

Earlier quoted context omitted.

A lot of things are coming straight from C#, so it’s battle-tested there before inclusion I guess.

As someone unfamiliar with C# but interested in how languages impact each-other, could you provide some examples? I know C# was heavily inspired (perhaps not a strong enough word) by Java, but not as familiar with the opposite. Java does seem to absorb from tried and tested ideas. There are a few major features I can think of that have largely come from or been inspired by popular and mature 3rd party libraries (time…

Java employs the “last mover advantage” strategy. They wait a bit for other mainstream-ish languages to be a testbed for a new feature, and if it proves worthwhile, they try to incorporate it into the language. But a new feature is a huge responsibility, since it will have to be maintained “forever”.

C# on the other hand is quite brave and quick to implement everything under the Sun, sort of similarly to c++ - which sooner or later will create a really bloated language (imo, both are already quite complicated). And in backward compatibility, Java definitely wins the cake.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#116
post #82

What's the best way to run java apps in a container nowadays? The official openjdk images are based on "oracle Linux" and that doesn't sound right :) is there good small and well supported java image based on a popular distribution?

Isn't Oracle Linux basically rebranded RHEL?

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#117

They broke backwards compatibility when they moved from 8 to 9. If this is all we got out of it after all this time, IMO it wasn't worth the change.

They broke some dependencies that depended on JVM internals, that was never promised to not change (how could they implement anything otherwise?). They implemented a strong encapsulation by default so that in the future, such a step won’t be necessary ever.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#118

Earlier quoted context omitted.

https://docs.scala-lang.org/sips/value-classes.html

Ah right - that's not really what we're talking about here, even though they have the same name.

“Codes like a class, works like an int!” - Taken from the top of the page.

This is exactly what Value Classes are in Scala. You supply an underlying value which is then interpreted as the value itself, not a reference.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#119
post #88

Earlier quoted context omitted.

Which doesn’t have value types because it should be implemented in the JVM?

It has Value Classes which are essentially the same thing. They transpile down into the value itself but wrap the value in extra functionality if you so choose.

They can only wrap a single primitive type - it’s a nice feature but nothing extraordinary. When Java implements primitive types, Scala will probably use this same construct. But the change have to come from the runtime level.

Re: A categorized list of all Java and JVM features since JDK 8 to 16

#120

Earlier quoted context omitted.

Now we've got Spring, which in my, admittedly limited, experience does a great job of transforming what could have been compile-time errors into run-time errors.

The wheel of karma is ever-turning, though [0],[1]. Disclosure: I work for VMware, which sponsors Spring development. [0] https://spring.io/blog/2021/03/11/announcing-spring-native-b... [1] https://github.com/spring-projects-experimental/spring-fu

Spring native is a game changer for so many organizations using containers for startup times. There are other spring related issues you still have to deal with
Post reply on HN