C# 9 Records were reference types (classes). C# 10 brings Record Structs.
public readonly record struct Point(int X, int Y);
This gives you:
1. Value semantics (stack allocation).
2. Immutability.
3. `ToString()` printing content.
4. Zero allocation!
Use this for high-frequency types like GEO coordinates, financial ticks, or composite keys.
Discover more from C4: Container, Code, Cloud & Context
Subscribe to get the latest posts sent to your email.