Live data from Hacker News

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

advancedweb.hu

51–60 of 243 posts

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

#51

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?

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.

Just use micronaut if compile time errors is what you want. It can even validate generated queries.

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

#52

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

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

#53
post #9

Earlier quoted context omitted.

You don't really need to hold out hope for this... it is coming and soon. It's been in active progress for years now (its a huge undertaking).

Is there an update somewhere that I've missed? I keep looking for updates and haven't seen them. (And yes, I know it's a huge effort, I was definitely not trying to say that it should be an easy change to get into the language)

There are JEPs out for parts of it now - Primitive Objects (which is the new name for value types) https://openjdk.java.net/jeps/401 and Unify the basic primitives with objects https://openjdk.java.net/jeps/402

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

#54

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.

It also gets a bad rep because of Oracle.

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

#55

After a long stint with Scala, I recently came back to Java because I'm setting up a team for a greenfield project. Java has a good balance for ease of use, type safety, massive+mature ecosystem, and talent pool. The new language features (post v5) and framework maturity help reduce the "bloated" feeling that made me switch to Scala. Still not happy with the semicolon.

You might consider Kotlin then. It’s more JVM-aligned than Scala, but waaaay terser than Java (as yet — the Java team is making great strides).

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

#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

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

#57
post #43

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.

Well said :) . Spring looks so much as to show how useful ideas can be misapplied with catastrophic results. For example, liberate encouraging of dependency injections leads to multitude of interfaces which are only ever implemented once by a production code class, and maybe one more time by a test class, even though Java has all methods virtual and testing could be done without requiring the interface.

>> Java has all methods virtual and testing could be done without requiring the interface.

Not sure what you mean by that. I thought that interface/implementation divide is the way to implement virtual calls. Unless you want testing frameworks to do bytecode instrumentation.

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

#58
post #8

Waiting for project loom [1] [1] https://openjdk.java.net/projects/loom/

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

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

#59

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

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

#60
post #8

Waiting for project loom [1] [1] https://openjdk.java.net/projects/loom/

Worth keeping in mind that the implementation they have chosen of stack copying from the heap has a larger performance overhead than something like Go which was designed around green threads/fibers/virtual threads/ etc. from the start.

If you can keep your stack size very low in each task then this probably won’t be noticeable if you are doing lots of IO which can trigger wakeups. More of a replacement for an async/await state machine for handling a request than something like a goroutine you could use for everything.

I have a feeling lots of existing Java libraries and frameworks won’t work well with it. Will be interesting to see how it plays out.

Post reply on HN