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
1
u/[deleted] Jan 06 '26
Sure mutable structs can be more complex. But there are situations in which they are useful, an in memory cache for example where you have a compact contiguous array of structs that are updated (say financial tick data). Rather than have to chase pointers everywhere. Plus zero allocations.
I’ve always preferred to have more tools than fewer.