Advanced C#: Functional Programming Patterns (2020)
1h 55mAdvanced2020-08-11
Authors

Walt Ritscher
Programmer, UI Designer, Staff Instructor at LinkedIn Learning
Course details
Functional programming offers developers a straightforward way to tackle modern software problems like massive scale, distributed systems, and multiple threaded runtimes. Curious about how to work functional programming patterns into your .NET applications? In this course, Walt Ritscher shows you how. Discover how to leverage the functional programming features in C# to transform your code. Walt covers key topics such as immutability, higher-order functions, and why expressions are better for functional programs. Plus, learn how to compose function flow in C# using pipelining; work with functional programming concepts like map, filter and bind in LINQ; and more.
Skills covered
C#Programming FoundationsProgramming LanguagesMicrosoftSoftware DevelopmentDeep Dive (X:Y)
Concepts
Introduction
- Functional programming patterns
- What you should know
- Working with GitHub
Overview
- Overview of the functional programming concepts
Favor Pure Functions
- Write pure functions for better code
- Example of an impure function
- Refactor impure function to pure
- Reduce code side effects
- Don't mutate input arguments
- Use an immutable argument
Immutable Types
- Principles of immutable types
- Read-only properties
- Instance method in immutable type
- Use helper methods to create new instance
- Use factory method to create instance
Side Effects and I_O
- Work with files
- Calculate the total in pure function
- Randomness in functional programming
Choose Expressions
- Why expressions are better for functional programs
- Rewrite statements as expressions
Functional Functions
- Use Func_T_ for first-class functions
- Higher order functions
Function Composition and Pipelining
- Composition patterns
- Compose functions
- Pipelining with extension methods
- Pipelining with generic methods
- Pipelining with IEnumerable
Work with Lists
- Understand map and other concepts
- Map with LINQ select
- Filter with LINQ where
- Flatten with SelectMany
- Join with SelectMany
- Fold with Sum and Aggregate
Conclusion
- Next steps