mvonballmo / CSharpHandbook

The focus of this document is on providing a reference for writing C#. It includes naming, structural and formatting conventions as well as best practices for writing clean, safe and maintainable code. Many of the best practices and conventions apply equally well to other languages.
28 stars 5 forks source link

Add warning about records vs. struct records #10

Open mvonballmo opened 2 years ago

mvonballmo commented 2 years ago

Notes

A struct record has mutable properties, whereas a record has immutable properties. A readonly struct record has immutable properties. Be aware that simply changing record to struct record will also change formerly immutable properties to mutable ones.