Skip to main content
00:00/00:00
Lecture 2 of 61

Don't be making side effects

Download Course (Free)

Course Content

0 / 61 completed
Section 1: Introduction3 videos

How to access the sample code on GitHub

1m

What you should know

1m

Functional programming patterns

1m
Section 2: Overview5 videos

Don't be making side effects

2mNow Playing

What is functional programming

3m

Core principles of functional programming

5m

Monads, currying and other terms

1m

The functional parts of C#

4m
Section 3: Favor Pure Functions9 videos

Function categories

2m

Write pure functions for better code

3m

Example of an impure function

2m

Refactor impure function to pure

3m

Don't mutate input arguments

1m

Use an immutable argument

4m

Reduce code side effects

2m

What about impure class properties

5m

Refactor side effect example

1m
Section 4: Side Effects and IO3 videos

Work with files

6m

Filter with LINQ Where

2m

Calculate the total in a pure function

2m
Section 5: Functional Functions6 videos

Functional function concepts

4m

Use FuncT for first class functions

3m

Higher-order LINQ

3m

Higher-order filter example

2m

Higher-order transform example

1m

Return function from function call

5m
Section 6: Immutable Types7 videos

Simple immutable example

2m

More principles

2m

Principles of immutable types

1m

Read-only properties

3m

Instance method in immutable type

3m

Use factory method to create instance

4m

Use helper methods to create new instance

3m
Section 7: Choose Expressions6 videos

Why expressions are better for functional programs

1m

Some examples of C# expressions

2m

Rewrite IF statement with expression

6m

Rewrite SWITCH statement with expression

3m

Rewrite FOREACH with expression

2m

IsPrime function as an expression

2m
Section 8: Function Composition and Pipelining5 videos

Learn the composition patterns

4m

Compose functions

5m

Pipelining with extension methods

2m

Pipelining with generic methods

2m

Pipelining with IEnumerable

4m
Section 9: Work with Lists7 videos

Understand Map and other concepts

3m

Map with LINQ SELECT

4m

Map to a different type

3m

Join with SelectMany

3m

Filter with LINQ WHERE

4m

Flatten with SelectMany

4m

Fold with SUM and AGGREGATE

6m
Section 10: Randomness6 videos

Randomness in functional programming

3m

A functional Random class

6m

Extension methods for various types

3m

Specify a smaller range of random numbers

2m

Randomize the order of a list

4m

Create a random list

3m
Section 11: Other Functional Types3 videos

Replace VOID with the UNIT class

2m

Replace NULL with OPTION

5m

Explore the Either type for error handling

4m
Section 12: Continuing Your Journey1 videos

Next steps

1m