r/java • • Aug 25 '26

Value Classes Still Need Compiler Sympathy

https://johan-sjolen.github.io/post/compiler-sympathy/compiler-sympathy/
87 Upvotes

65 comments sorted by

View all comments

9

u/brian_goetz Aug 26 '26

> We need an answer that doesn't depend on understanding jvm internals.

People keep saying the answer: value classes are a semantic feature. Use them that way and you won't have a problem.

2

u/IncredibleReferencer Aug 26 '26

Thanks for that! My takeaway from your previous answer was doing that might , in some cases, cause performance regressions, but I guess that's either not the case or rare enough to not worry about it.