Using Immutable Data Structures in C# and .NET
summary
Argues that immutability in C# reduces reasoning overhead and threading bugs and shows practical tools: System.Collections.Immutable where immutable lists create new instances on Add, AutoMapper and Newtonsoft.Json which map into constructor parameters, and System.Text.Json which requires custom converters for immutable types. Recommends refactors: prefer projection over mutation, use factory/builder patterns, immutable collections for shared data, and accept tradeoffs with Entity Framework and serializers when full immutability is impractical.
AI-written summary · about
chapters (49)
- 0:00Introduction
- 2:10Fsharp
- 3:30How do you know if someone is functional
- 3:44C is something that is Bill
- 4:14Bad immutability jokes
- 4:24Scott Hanselman example
- 7:28List example
- 8:50Thinking
- 9:07Synchronization Quadrant
- 10:12Moores Law
- 11:36History of Immutability
- 12:35Immutable Classes
- 12:56Auto Properties
- 13:21ReadOnly Structures
- 14:33Anonymous Types
- 15:25Immutability
- 15:45Mutation Patterns
- 16:12Unnecessary Setters
- 16:59Columns for Table
- 17:17Column Type String
- 17:46Column Type Setter
- 18:36Projection over Mutation
- 19:04My Main Principle
- 19:39Open Setters
- 19:56Setup Methods
- 21:09Refactoring
- 22:11Immutable List
- 23:07Mutable List
- 24:01ReadOnly List
- 24:44AutoMapper
- 25:36Constructor
- 26:31SystemTextJason
- 27:47Builder Pattern
- 28:26DBContext Options
- 29:15No Open Setters
- 29:30Functional Ideas Only Work in C
- 30:12Immutability in C
- 30:40Entity Framework
- 32:32Hitting Ranks
- 33:37Tradeoff
- 35:36American Currency
- 35:51Immutability Has Helped Me Evaluate
- 38:19Align With Your Team
- 39:16Application Architecture
- 40:26Persistent Data Structures
- 40:43Event Sourcing
- 41:38Redux
- 42:41Change your mind
- 43:01Questions
related talks
48mUsing Immutable Data Structures in C# and .NET
50mImmutable code in .NET
54mImmutable Collections in NET: Why and How?
01h 01mThe Power and Practicalities of Immutability
42mPure Functions and Immutable Objects
01h 00mImmutable Data with Java: Using Immutable Data Structures
48mPurely functional data structures demystified
38mImmutability is everything!
