~/talk

Using Immutable Data Structures in C# and .NET

Talkat DevConf 2018 · 2018-09-26..09-28· [dotnet]
slides:none on file

Shows why open setters cause runtime NullReferenceExceptions by mutating shared Order objects and demonstrates a practical refactor that uses projection with LINQ to create display models instead of editing originals. Introduces System.Collections.Immutable via ImmutableList.Create, shows that AutoMapper/Json.NET support will construct immutable types, and recommends Builder and Factory patterns, constructor injection with ArgumentNullException checks, and mutating sparingly because EF requires mutability and won’t be replaced.

AI-written summary · about

  1. 0:00Introduction to immutability
  2. 3:33Dangers of mutable code
  3. 9:10Reasoning about state
  4. 12:31Multi-threading and safety
  5. 15:13Evolution of C# immutability
  6. 19:01Leveraging LINQ and projection
  7. 23:29Refactoring for immutability
  8. 28:32Using immutable collections
  9. 30:32Library support
  10. 33:44Builder and factory patterns
  11. 40:02Pragmatic conclusions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.