4 ms·
While what you're saying true I'm pretty sure it's going to create a lot of confusion - these things share a lot - all of them have all the fields final for exa
by boroboro4 5y ago
While what you're saying true I'm pretty sure it's going to create a lot of confusion - these things share a lot - all of them have all the fields final for example, and feel like "simple" "data" classes.
I can see their reasoning to add value classes in addition to primitive classes, but the difference between them is going to create the most confusion, since they are identical in terms of requirements to classes themselves.
- kaba0 5y agoIt will definitely give some additional learning to people, but I feel like their usage is still quite idiomatic. If someone didn’t even hear about these, he/she can still code as if they are identity-based classes for the most time (chances are they are not the one writing vanilla concurrent code with synchronized or using some advanced optimizations with identityHashCode), and conversely spamming value and primitive may fail at compile time or at worse, runtime with some meaningful error.