3 ms·
The biggest difference is that Records are Immutable.
by ratww 5y ago
The biggest difference is that Records are Immutable.
- whoisthemachine 5y agostructs can be made `readonly` as well. The biggest difference IMO is a record is still a class, so it's still copy-by-reference rather than copy-by-value, potentially giving performance gains when passing data around, and leaving a shortcut for value-comparisons (if two variables reference the same object, you obviously know it is the same).