3 ms·
Aren't classes already allocated on the heap? Why would C# need another type like that?
by BubRoss 7y ago
Aren't classes already allocated on the heap? Why would C# need another type like that?
- UK-Al05 7y agoThere low overhead data classes. It's takes a lot create a data class correctly. Including implementing equals, hash etc. Plus a good syntax for creating records. And encourages immutability.
- shawnz 7y agoThe point of both the C# feature and the Java feature is to reduce boilerplate. They are not for improving the performance of apps.
- zamalek 7y agoThe comment is wrong. Records are syntactical sugar for either value or reference types (depending on the language). They simply automatically implement equality, constructors and so forth.