← Back to context

Comment by homebrewer

2 months ago

No, records are a reduction in boilerplate for regular classes (the result also happens to be read-only — not deeply immutable, mind you). Value types are in the works:

https://openjdk.org/jeps/401

Hmm looking at that it seems like being a struct type is a non-goals they seem to explicitly call out C# value types as a different thing...

Smaller objects from dropping identity is nice but it really doesn't seem like it gives you more explicit memory layout, lifecycle, c interop etc that C# has with their structs. Maybe I'm missing something.