r/programming • u/davidalayachew • Jul 16 '26
Dan Smith from OpenJDK -- Identifying JDK value class candidates
https://mail.openjdk.org/archives/list/core-libs-dev@openjdk.org/thread/Y72NRXM7KYBX43OKYBQMVKOZDWKG4MHS/
5
Upvotes
View all comments
Show parent comment
0
u/lood9phee2Ri Jul 16 '26
Java is not in a vacuum though, everyone here freaking already knows C# exists and has structs / value types, and the typical Microsoftie worming into your organisation trying to push dotnet/c# over java knows it as a talking point.
List in particular seems like a bad example for your point (which I'm not denying entirely, but clearly don't prioritise as much as you) - java.util.List specifically is an interface anyway, but also the likes of AbstractList also out of scope for the value-isation because it already has a nonfinal protected mutable field that is now-unfortunate - they had no reason to think of it at the time of course, but thus you can't actually use AbstractList or its subclasses like ArrayList if you want the List impl itself to have the value class semantics rather than just each element of a given List being a value class instance (that bit is much more useful for tight array packing of course) - that may be weird in general but perhaps not for some pure immutable use cases.
I dunno, perhaps separate AbstractValueBlah cases in general since AbstractList, AbstractSet etc. already locked in, even if it's only AbstractList that right now has the problem.