Immutable code in .NET
summary
Shows how to make .NET code immutable using C# features, System.Collections.Immutable, and JSON.NET, and measures cost: ImmutableList add is ~150x slower than List<T> while some persistent-array approaches are only ~2x slower. Builds a Redux-style store and reducers for a Person → favorite movies example that supports pure-action POCOs, replayability/time-travel debugging, and easy unit testing. Demonstrates a real rewrite (personal-trainer app) that works immediately, argues for event sourcing, normalization to save memory, and immutable deploys via VM/container images.
AI-written summary · about
chapters (35)
- 0:00Intro
- 0:41Agenda
- 1:05Immutability
- 3:59Private setters
- 7:12Performance
- 10:13Frontend
- 10:47Patterns
- 11:37Debugger
- 12:01Dataflow
- 12:37TDD
- 13:22React
- 14:21I changed
- 16:39Observable pattern
- 18:07Unicycle data cycle
- 19:10Work
- 19:55Store
- 23:27SetPerson
- 27:52Benefits
- 29:26Pattern
- 30:12ColdRecord
- 33:17How efficient is this
- 33:46Optimization
- 34:03Reuse
- 35:37Replayability
- 36:56References
- 37:46Client Applications
- 38:01Scalable Applications
- 38:41Paradigms
- 41:22Actors
- 42:44Events
- 42:59Why immutability
- 45:58Containers
- 47:00Virtual Machines
- 49:33Conclusion
- 49:49Outro
related talks
47mUsing Immutable Data Structures in C# and .NET
48mUsing Immutable Data Structures in C# and .NET
54mImmutable Collections in NET: Why and How?
01h 01mThe Power and Practicalities of Immutability
42mPure Functions and Immutable Objects
52mImmaculate Code (pure code)
34mImmutability: Putting The Dream Machine To Work
56mFunctional Programming on .NET - The Best of Both Worlds
