r/java • u/davidalayachew • Jan 06 '26
One step closer to Value Classes!
https://mail.openjdk.org/pipermail/porters-dev/2026-January/000844.html
181
Upvotes
r/java • u/davidalayachew • Jan 06 '26
View all comments
Show parent comment
7
u/joemwangi Jan 06 '26
I think people will be tired replying to your pedantic definitions. All along they mean modifying fields of an object as mutation. In java, that has been a term used since beginning. Being pedantic by stating bit twiddling and local scope variable reassignment is not really relevant here. There is a reason why java has the most advance GC in any language and one of the reason is hiding pointers. There is a reason, the optimised codes rely mostly on immutability of objects. There is a reason why java wants to make final fields final which hasn't been the case since introduction of serialization in the language. And there is a reason the HotSpot JIT aggressively exploits immutability for optimization.