Re:Java's records, Lombok's data, and Kotlin's data classes
by the_af on Friday May 07, 2021 @03:44PM
(#27080109)
Precisely: you did not write the original solution, which is where immutability shines. It's a code comprehension tool; it gives you guarantees about code you didn't write. That's a huge boon!
[ Parent
| on HN ]
Re:Java's records, Lombok's data, and Kotlin's data classes
by AtNightWeCode on Friday May 07, 2021 @04:09PM
(#27080334)
There are no guarantees that it is the same object you get so it is pointless.