News for hackers. Stuff that matters.
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!
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.
Re:Java's records, Lombok's data, and Kotlin's data classes by slver on Saturday May 08, 2021 @07:48AM (#27086259)
No one uses immutables to make sure they “get the same object”. What does that even mean?