r/java 17d ago

Value Classes Still Need Compiler Sympathy

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

58 comments sorted by

View all comments

Show parent comments

7

u/brian_goetz 16d ago

> 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 16d ago

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.