Live data from Hacker News

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

advancedweb.hu

61–70 of 243 posts

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

#61

Java gets a bad rap from people that used it late 90's through early 2000's and got burned out by XML and design pattern heavy frameworks but its a lovely language that with a little discipline can be used to create very lean looking code. Go is one of the HN darling languages and I work in Go everyday for work (and generally like it), but I really wish I could reach for Java most days.

Java isn't the worst C++ program I know.

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

#62

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…

Kotlin supports reified generics (through extension methods) Java is getting reified generics and more importantly generic specialization which is critical for performance https://www.reddit.com/r/java/comments/m2dfb5/parametric_jvm...

Kotlin’s reified generics are pretty limited — they only work in inlinable situations, as there is no JVM support.

I assume that Kotlin will quickly add proper reified generics support as soon as the JVM allows.

(Your link above is about reified generics in the JVM, not just the Java language. Which is great news.)

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

#63

Earlier quoted context omitted.

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

Those are nice advances but I hope that spring will one day support compile time validation of generated queries and of beans like Micronaut do.

I'm confident it'll reach that point.

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

#64
post #29

All the backend projects I work on were originally written in Java. I'll admit that Streams and Lombok make it a somewhat pleasant experience to work with, at least compared to when I used it in college (I think Java 8 was newest?). But that said, I once tried writing a new feature in Kotlin, and now all our code is Kotlin. I don't really see how Java can compete with the non-nullable types, data classes, and type-in…

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

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

#65

Earlier quoted context omitted.

I am unreasonably excited by Loom, for two reasons: 1. I cannot wrap my head around library-based reactive systems. I have tried and tried and continue to try. But they're like some of the original Go4 design patterns: they exist to solve the language , not the problem . Loom's promise to make steam-powered linear code behave mostly like a fully-dressed reactive library system is extremely welcome. 2. Structured conc…

What you're waiting for is already available with Kotlin coroutines (which has a very clean API btw) And no reactive streams still are useful for processing collection streams asynchronously and here again kotlin solve it all https://kotlinlang.org/docs/flow.html

I like Kotlin coroutines and I've used them, but they (this argument is controversial) have a function colouring problem. As the JVM adds virtual threads I expect that a rebasing of Kotlin's coroutines will remove that objection.

Plus, sometimes, I want to use Java.

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

#66

very beautifully put together. In fact, they should start with Java 5! Even in 2021, I see code bases (and devs) who dont know/use generics!

You'd think they'd get tired of all those casts everywhere.

Well that is why they write GO right ;)

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

#67

Earlier quoted context omitted.

“Java is a big DSL to transform XML into stacktraces” — so was the joke at the time when domain-specific languages were the hype. This, and the FizzBuzz, Enterprise Edition: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris... More seriously, what are you missing in Go that is well-done in Java? I assume verbosity of the code is still the defining characteristic of Java?

> 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 agree with your points here, but just want to add that, while Java's generics are better than the non-existent generics in Go, I still find Java's type system to be really subpar for today's era.

The type system is not strong or expressive enough to do full type erasure, but then we're stuck with type-erased generics, so it's just incredibly frustrating.

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

#68

Earlier quoted context omitted.

Those are nice advances but I hope that spring will one day support compile time validation of generated queries and of beans like Micronaut do.

I'm confident it'll reach that point.

...and probably well before Micronaut gets rid of its bugs, comes close to feature parity and generally matures as a framework.

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

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

Also, a lot of verbosity in Java came from people going off the rails with design patterns to hide crap multiple levels deep in a file with 5+ words in the class name.

If you have a hammer everything’s a nail.

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

#70
post #29

All the backend projects I work on were originally written in Java. I'll admit that Streams and Lombok make it a somewhat pleasant experience to work with, at least compared to when I used it in college (I think Java 8 was newest?). But that said, I once tried writing a new feature in Kotlin, and now all our code is Kotlin. I don't really see how Java can compete with the non-nullable types, data classes, and type-in…

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.
Post reply on HN