Thinking Functionally with C#
summary
Argues C# can be used as a practical functional language: replace for/foreach with LINQ Select/Zip/Aggregate and IEnumerable.Range, prefer switch expressions / pattern matching and tuples over ifs, make data immutable and functions pure (no voids), and handle errors with a Result<T> discriminated-union and Bind (a monadic chain). Shows concrete rewrites (actor/name mutation fixed by returning new object, price calculation as successive definitions), suggests trampolining as the single while-loop pattern, and reports fewer bugs, easier testing and simpler debugging.
AI-written summary · about
chapters (14)
- 0:00Introduction and background
- 2:44What is a programming paradigm?
- 5:04Imperative vs. declarative styles
- 6:41Core concepts and motivation
- 9:27Advantages of functional code
- 13:43Addressing criticisms
- 17:47Immutability and state management
- 27:24Results-oriented architecture
- 32:04Pure functions and testing
- 36:14Functions over statements
- 44:29Handling unbounded loops
- 48:53Project structure patterns
- 52:51Handling side effects with results
- 58:05Domain modeling and conclusions
related talks
01h 09mFunctional Programming with C#
01h 00mC#'s Functional Journey
58mFunctional Programming with C#
56mFunctional Programming on .NET - The Best of Both Worlds
58mFunctional Techniques for C#
58mTransforming Your C# Code to Functional Style
01h 03mFunctional Programming with C#
37mLet's get more functional
