Many devs assume readonly = immutable.
❌ Reality
readonly protects the reference, not the object.
readonly List<int> items = new(); items.Add(1); // allowed
✅ Fix
Use immutable collections when needed.
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
Many devs assume readonly = immutable.
readonly protects the reference, not the object.
readonly List<int> items = new(); items.Add(1); // allowed
Use immutable collections when needed.