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.
A categorized list of all Java and JVM features since JDK 8 to 16
61–70 of 243 posts
Re: A categorized list of all Java and JVM features since JDK 8 to 16
#62Is 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...
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
#63Earlier 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.
Re: A categorized list of all Java and JVM features since JDK 8 to 16
#64All 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…
Re: A categorized list of all Java and JVM features since JDK 8 to 16
#65Earlier 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
Plus, sometimes, I want to use Java.
Re: A categorized list of all Java and JVM features since JDK 8 to 16
#66Re: A categorized list of all Java and JVM features since JDK 8 to 16
#67Earlier 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…
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
#68Earlier 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.
Re: A categorized list of all Java and JVM features since JDK 8 to 16
#69Earlier 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.
If you have a hammer everything’s a nail.
Re: A categorized list of all Java and JVM features since JDK 8 to 16
#70All 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.