Hacker News new | ask | show | jobs
by Zababa 1775 days ago
Records seems very nice! What I wonder is if people are going to use them, considering Java is a bit old at this point and lots of code already exists. Refactoring to use object would be a heavy cost. Maybe some new framework and ecosystems will appear based on new features of Java?
1 comments

Refactoring to use them is not really hard, as they are easily interchangeable with regular classes. They are pretty much syntax sugar for this class pattern here: https://stackoverflow.com/a/63615514
That's true, but that's still a large refactoring to do, especially with going from mutability to immutability. The community might also just not like them.
On the other hand in some cases this type of refactoring might actually reveal design issues with the code, maybe even bugs.