Write C# Structs (Not Always) Classes
summary
Explains how to write C# structs correctly and why to prefer them sometimes over classes, covering memory savings and performance benefits as well as pitfalls like boxing, equality and defensive copies. Uses new C# 7 and 8 language features to address those problems and shows practical patterns for building structs instead of defaulting to classes.
AI-written summary · about
