Immutability rocks, right? When a type is immutable, it’s usually easier to reason about your code, easier to share data safely, and easier to make money ooze from every USB port. That’s the promise, at least. I heard an F# developer say it, so it must be true.

Unfortunately, when a language or platform isn’t designed to encourage immutability, immutability can introduce its own pain points – and sometimes they can be subtle.

Come with me on a journey to explore the different options for implementing immutability in C#, see how it’s become somewhat simpler over the various versions, and consider what the future *might* have in store.

About Jon

Jon Skeet is a software engineer for Google in London, who plays with C# (somewhat obsessively) in his free time. He loves writing and talking about C#, and the third edition of ‘C# in Depth’ was published in September 2013. Writing less formally, Jon spends a lot of time on Stack Overflow… where ‘a lot’ is an understatement. Give him a puzzle about how C# behaves which gets him reaching for the language specification, and Jon is a happy bunny. Jon lives in Reading with his wife and three children.