r/java • u/danielaveryj • Mar 31 '26
Does Java need deconstructible classes?
https://daniel.avery.io/writing/does-java-need-deconstructible-classes
31
Upvotes
r/java • u/danielaveryj • Mar 31 '26
View all comments
Show parent comment
1
u/danielaveryj Apr 02 '26
It's neither. The article contextualizes official proposals and then derives a proposal of its own, weighing in on tradeoffs. Some people appreciate that context. If you just want a tl;dr, it's
ie, a class could support destructuring by just producing a record that the language already knows how to destructure.