Live data from Hacker News

Java's records, Lombok's data, and Kotlin's data classes

nipafx.dev

1–10 of 294 posts

Re: Java's records, Lombok's data, and Kotlin's data classes

#6
> Actually, records are even better* than tuples. EP 395 says: > > Records can be thought of as nominal tuples.

They are certainly not better, that's just a sad click-bait (the author even admits that).

Sometimes nominal typing is better and sometimes structural typing is better. Forcing people to always use nominal types just ends in a lot of generic or long/meaningless names - one can already see this in Java.

Re: Java's records, Lombok's data, and Kotlin's data classes

#9
Who is arguing otherwise? It's assumed that when a language adds a new feature that's historically been provided by libraries, it's probably better optimized. CompletableFutures, Streams, Date/Time. For many they've replaced libraries filling the gaps.

But not all of us can use JDK 14, and will continue to use Lombok if we're writing in Java.

Post reply on HN