3 ms·
"ImmutableStruct" does not communicate the key detail that these are compared by value, not identity. "Data class" is a common term for this in other languages,
by djur 4y ago
"ImmutableStruct" does not communicate the key detail that these are compared by value, not identity. "Data class" is a common term for this in other languages, including Java, Kotlin, and Python. "Data" is definitely more concise (almost by definition) and I would argue it's more precise as well.
- nayuki 4y agoIn Java, "data class" might be a common term that existed for a long time. But a language-level feature was introduced in SE 14 as "records": https://docs.oracle.com/en/java/javase/14/language/records.html https://docs.oracle.com/en/java/javase/14/language/records.h...