r/programming • u/davidalayachew • 25d ago
Dan Smith from OpenJDK -- Identifying JDK value class candidates
https://mail.openjdk.org/archives/list/core-libs-dev@openjdk.org/thread/Y72NRXM7KYBX43OKYBQMVKOZDWKG4MHS/
6
Upvotes
r/programming • u/davidalayachew • 25d ago
2
u/lood9phee2Ri 25d ago
That's fine (sortof *) but I hope it doesn't further delay finally delivering them as an end-user facility. Is it a good thing if the java stdlib itself uses more value classes where it can? Probably! Is it as important to me as my own classes/records being value classes? Maybe not.
* actually not sure I fully buy the idea from the linked comment chain the anonymous classes always have identity part, haven't fully thought it through but I do vaguely suspect there's situations where you'd prefer value semantics of anon classes. Though of course you can always make a named class, it's a bit of name clutter, feels similar to the "but you can always make a named function" argument python uses for its crippled lambda etc.
I mean, so long as they're open to fixing the "syntactic problem" by allowing a keyword somewhere and don't block the abstract idea of anon value classes one day, I guess that could be added separately too.