Java Language Futures - Spring 2024 Edition

preview_player
Показать описание
The *Java* *Programming* *Language* is evolving fast! Watch this video for a whirlwind tour of recent changes as well as a peek into the future. Discover the features you’ll be using when coding Java code next year and beyond!

Video recorded during _*Java*_ _*Day™*_ _*London*_

*Tags* #Java #JDK #OpenJDK #InsideJava #programming
Рекомендации по теме
Комментарии
Автор

The pattern showed for AsyncResult<V> looks exactly like a Rust enum, a shortcut to get that kind of thing would be great.

keineangabe
Автор

Still crying for the Elvis operator. For business and database logic, this is the most missing Java feature. We don't want to wrap everything in Optional and lambdas.

peacemakerle
Автор

It took me an embarrassingly long amount of time to userstand that this was not about new features applied to the spring

I really like the new data oriented philosophy. The way to represent future's state with sealed class makes me think of rust's enums !
I wonder if the rest of the APIs will shift this way. I'm thinking about optionnals, and maybe even an error type ?? (Since we still can't handle exceptions in a functionnal way without creating some custom "Try" type. It really is a pain point I experienced

greatso
Автор

The "with" thing seems like a great addition to records. I live in Java 11 World right now, but will be moving up to JDK-21, hopefully, soon. I simply do not understand the massive amount of fan-fare about records, although the most interesting concept about that is that all records are "Read-Only" which seems like a reasonable addition. I know that while something (anything, really) is under development it will seem a lot more important to the programmers until they are finally finished with it.

rtorello
Автор

Why records not return implicity in the accesors a defensive copy of a mutable fields?

cobrab
Автор

37:50. I fundamentally disagree. You could have made the exceptions on the original signature checked and get the same benefits of the compiler telling you if you miss any case plus:
- Avoids the additional boxing due to the `AsyncResult` type, plus better performance in the happy path
- You get stack traces in the cases of failure (`Failure`, `Timeout` and `Interrupted`)
- You can quickly propagate to the caller unlike `AsyncResult` (no `?` operator or similar)
- Compositions comes for free. If a function `f` throws `X` and function `g` throws `Y`, then a function that calls both functions can throw `X & Y` due to the fact that `throws` supports a union of exceptions. With a sealed interface you don't get that, meaning that the dev now needs to create a wrapper for the result types (see `anyhow` in Rust for example)

I don't think we're gaining anything valuable with this. I would much rather have proper support for Nullable types or a better `catch` clause for multiple exceptions types (syntax sugar on top of multiple `catch` clauses)

valcron-
Автор

AsyncReturn looks great! good to know about that

konrad
Автор

Whats the benefit of records and sealed interface vs an enum?

delanym
Автор

Record pattern matching looks very verbose, why can’t we just shape instanceof Circle c and just use it?

udayaprakashk
Автор

Using records widely here in business logic. But I really dislike that the canonical constructor of public records can not be private. Now, people are exposing constructors which should be private because there are static create-functions or builders which should be used instead.

peacemakerle
Автор

Why Java is becoming more and more like Scala Language ?

millodev
Автор

2:04 "we've been delivering quite a lot". No, that's not a lot. Scala delivered all of those features in one shot.
4:08 Productivity-oriented language features: Scala can pattern-match on lists. I think that's very productive. Java doesn't need to copy Scala if it has better features.
22:11 looking at the 2 aligned arrows on the `case` lines, I wonder if there's any tool that can align those arrows for me (something like scalafmt).
44:21 suppose that record A contains record B which contains record C ... which contains record Z. Now I want to create a new instance of A from another instance of A where a field in the record Z changes its value, how do I write that?
Does "record with" create more garbage for the GC to collect that a mutable class?

avalagum
Автор

I thought string templating just got dropped? (which is actually a success story in a way)

simonmassey
Автор

“Only use immutable data”, my database would like a word.

JoeBrigAI
Автор

AsyncResult is useless ... Try .. catch will be more clean .

I will forced to implementar all egde cases ? ( Timeout and interrupted )

ricardojlrufino
Автор

Record still pisses me of. Start with a record. Then you need mutable state, so you have to change it to a class, and then you have to add in all the junk code that records got for free.

guttormvik
Автор

33:12 lol, guy has never heard of multicatch from Java 7

bluemeriadoc
Автор

Java is ancient in terms of features. All of this presentation is just copying the low hanging fruit of Scala which is a JVM language - 10 years later!

Talk about "last mover advantage"

BloodnutXcom
visit shbcf.ru