
Explore the theoretical basics of functional programming and programming paradigms, including what functional programming is and why FBI concepts matter; learn the importance of functions and the benefits of FBI.
Explore programming paradigms with a focus on functional programming in C#. Learn how generics, Linq expressions, and method extensions enable functional style in an object oriented language, emphasizing immutability.
Explore functional programming as a declarative paradigm that treats computation as the evaluation of mathematical functions, avoids changing state, and uses immutable data for predictable, testable code.
Explore how functional programming centers on functions as first-class citizens, advocates small, single-responsibility functions with no side effects, and limits parameters to three, and aligns with patterns and solid principles.
Discover why to learn functional programming concepts, even without a truly functional language, and see how FP ideas yield shorter, more understandable code, immutability, no side effects, and safer concurrency.
Explore how functional programming treats computation as the evaluation of mathematical functions, avoids changing state and mutable data, and enforces a declarative style for more predictable, maintainable code.
Discover immutability and purity in functional programming, and analyze how side effects influence architecture. Learn how to remove side effects using command-query separation and embrace a declarative style.
Explore immutability in functional programming with C#, compare mutable and immutable objects, and see how returning new instances defeats temporal coupling and improves readability, safety, and predictability.
Explore how immutability and pure functions eliminate temporal coupling by removing shared state and most side effects, improving data flow from creation to startup.
Examine how side effects are observable changes to system state and how purity defines true pure functions, with examples like logging, division by zero, and state mutations.
Explore how side effects and state changes shape software architecture. Contain side effects at UI and data-access boundaries to protect the domain logic.
Apply command query separation by designing functions as either commands that perform actions or queries that return results, avoiding mixed logic in a single function.
Explore immutability and absence of side effects through a declarative expression-based style. See how linq-like operators and extension methods transform a collection while keeping the original unchanged.
Examine expressions with operators in c#, comparing the ternary, null-coalescing, and null-propagation operators to plain code, and showcase string interpolation for clearer, robust output.
Recap immutability and the distinction between pure and impure functions, emphasizing keeping domain logic mutable while isolating side effects at system boundaries through command query separation.
Explore functional programming in C# from a new perspective and master extension methods or properties, expression-bodied members, pattern matching, tuples, deconstruction, and local functions in C# 6 and 7.
Learn how extension methods add functionality to existing types and generics, avoid unwanted inheritance, and apply practical date-time formatting examples while highlighting primitive obsession risks.
Explore autoproperties and immutability in C# via a character armor example, showcasing immutable getter-only properties. See how constructor initialization and inline assignment interact, with priority and expression-bodied members.
Explore expression bodied members in C#, refactor the damage method and properties into concise one liners, understand getter only properties, immutability concerns, and when to avoid overuse for readability.
Explore pattern matching from the functional paradigm in C#, demonstrating how case clauses match on patterns, not constants, and how to handle objects as string or integer.
Explore value tuples in C# 7 and the System.ValueTuple type to return multiple values efficiently. Demonstrate deconstruction and named or anonymous parameters to access results.
Use local functions to define functions within a function, keeping logic cohesive and improving readability during refactoring, including scenarios with yield and async for faster feedback.
Learn functional c sharp features and what functional programming is about. Extend types with read-only methods, use properties for immutability, and apply pattern matching with tuples and local functions.
Learn to achieve immutability in C# to prevent side effects and temporal coupling, using external and internal immutability, shallow and popsicle immutability, and the builder pattern for reduced memory pressure.
Examine a mutable type in C# and the risks of changing the validity range, highlighting data spoilage, stale results, and concurrency issues that immutability in functional programming aims to prevent.
Explore external immutability in C# by turning properties private, enforcing constructor-based initialization, and creating new instances to update values without altering existing objects.
Explain how to achieve internal immutability in a range type by using read-only fields and properties set only in the constructor, preserving external immutability.
Explore shallow immutability in C# by distinguishing read-only properties from mutable internal state, then apply popsicle immutability with a freeze mechanism to prevent further changes.
Demonstrate the builder pattern for immutable objects with a fluent API and a final build, and show testing via mocks for GPS and speed sensors.
Explain why mutable structures can misbehave, highlight the copy-by-value model as the essence of immutability in value types, and compare bad and good struct designs with arrays and indexers.
Explore immutability in C# by creating new instances instead of mutating state, avoiding read-only collections reflecting changes. Implement an immutable stack with a singleton empty instance, separating pop and peek.
Recap the shift from mutable to immutable types, highlighting external or observable immutability and internal immutability, risks of exposing mutable collections, and how the builder pattern enables an immutable API.
Learn practical functional programming in C#, and explore pipelining differences. Extend the disposable interface and string builder, and apply general extensions to compose uncomposable objects and build cold chains.
Explore pipelining: pass a function's output to the next to streamline data flow, avoid intermediate variables, and use method chaining to emulate pipelines in languages lacking a dedicated operator.
Explore extending IDisposable in C# by transforming procedural file parsing into a functional flow using factory methods, using extensions, and composing disposable types for cleaner code.
Explore refactoring a procedural string-building routine into a functional, extension-based approach using string builder extensions and string interpolation, improving readability, validation, and report generation.
Explore general extensions to thread intermediate results through a chain, enabling logging in the middle and type conversions while reducing procedural noise in functional C#.
Explore how extension methods can be powerful yet invite primitive obsession when representing money, and adopt a money value object or struct to encapsulate currency logic.
Summarizes functional programming techniques and pipelining, noting that pipelining feels more natural in F# than C#, and highlights disposable interfaces and extensibility through extensions.
Explore modeling errors and exceptions in C# with guidance on when to use exceptions, validating user input, and managing critical errors, while examining alternatives to exception-based control flow.
Explore the taxonomy of errors in software design, distinguishing recoverable and unrecoverable system and user code errors, and contrasting exceptions with error codes while highlighting stack unwinding.
Explore the historical problems of exceptions, from Java's checked exceptions and their versioning and scaling flaws to C#'s shift to unchecked exceptions, and discuss global handling and corrupted state issues.
Explore practical strategies for handling exceptions in C# apps: catch near the source, avoid assuming you know all possible exceptions, suppress noise when appropriate, consider preconditions, corrupted state, and performance.
Explore three exception handling strategies in C#: known-exception catching, policy-led catch-all with a critical list, and a complete catch-all, weighing reliability, team readiness, and application size.
Explore the command-query separation principle by refactoring a log-on method into a query and a command, and examine failure handling, return types, and caller expectations.
Learn the tester-doer pattern, where a test or property acts as a query and a doer method acts as a command, while noting concurrency risks and temporal coupling.
Discover how exceptions conflict with functional programming and replace them with result types and pipelining, using a general and a value-bearing result.
Embrace functional programming in C# by pipelining methods and employing the result monad to handle recoverable errors with extension methods, then refactor complex code into simple, readable flows.
Examine method signatures in a functional C# style: void commands must not fail, returnable commands may fail and require handling, and queries should return results, addressing exceptions in the BCL.
Explore the built-in bcl exception types and why concrete exceptions trump system exceptions in C#. Learn to throw argument exceptions with the correct parameter names and avoid common misuses.
Prefer the result monad for recoverable errors and avoid custom exception types; if you implement one, inherit from system exceptions, name with invalid or user exception, ensure serializability and constructors.
Conclude by contrasting exceptions with recoverable errors handled via the result glass, adopt functional signatures with command–query separation, and apply pipelining and method changes.
Explore why null values cause exceptions and maintenance pain, and examine strategies like the null object pattern, the maybe monad, and static analysis to check control flow and reduce nulls.
Identify the problems with nulls in code, where defensive null checks clutter the codebase and hinder readability. Understand how weak semantic cohesion and unclear checks lead to null reference exceptions.
Apply the null object pattern to replace nulls with an abstract entity and a do-nothing object, preventing null reference exceptions and enabling safe defaults like a null object cache.
Explore the maybe (option) concept in C#, contrasting nullable versus non-nullable references and using a maybe wrapper to represent a value or absence, with has value and has no value.
Automate null checks at method starts for reference types using an aspect-oriented weaving tool, preserving encapsulation and enforcing non-null inputs.
Learn static analysis as a non-running code approach, using annotations to mark input and output parameters and nullability, and practice with tools that analyze methods and prevent runtime errors.
Return an empty collection when a predicate yields no results, not null, to avoid null reference errors. This clarifies missing information and lets client code safely iterate without checks.
Explore strategies to reduce null values and maintenance costs by using the null object pattern, maybe monad, and nullable value types, plus static analysis tools, and return empty collections.
Bonus lecture invites you to join the mailing list for discounts on faith courses, access links to other video courses, and subscribe to the blog and Facebook updates.
Learn how to write C# code in a functional style. The “Functional Programming in C#” is for you if you want to improve your code, design and architecture. It means you are going to learn how to write code of the high quality: readable, understandable and reliable.
Teaching Approach
No fluff, no ranting, no beating the air. I respect your time. The course material is succinct, yet comprehensive. All important concepts are covered. Particularly important topics are covered in-depth.
Take this course and you will be satisfied.
Learn Functional Programming in the context of clean coding and building types of high quality.
Get Deep Understanding of what is Functional Programming
Learn how to design Immutable types in C#
Apply new C# 6 and C# 7 features to write better code in a functional style
Learn how to Extend and Compose any Types
Handle Errors and Exceptions in a functional programming style
Tackle the Problem of Null-Values by the means of functional programming
Foundations of Functional Programming
Despite the fact that C# is primarily an object-oriented language, it is very powerful on features which enable functional programming style. In fact, C# is one of the richest on features language among object-oriented languages in the world nowadays. But with great power comes great responsibility. It's challenging to use all those features in a right way.
You probably have already heard the following well-known statement: most code sucks. Well, this course is all about how to produce code which doesn't suck.
Owning skills of producing well-designed and well-implemented types with regards to functional programming principles.
Content and Overview
This course is aimed at all the C# developers, from beginners to seniors. Topics which are covered in the course are relevant for all kinds of C# developers since all developers design and implement types. The topics complexity is very different. There are plenty of very simple topics, and at the same time, there are topics which require from you a solid C# background. There are plenty of code examples throughout this course, so you will learn both theoretical and practical material.
We’re going to start with the theoretical foundations of the functional programming paradigm. You’ll learn what is Functional Programming and what are the benefits of applying that paradigm.
In the second section, we’re going to elaborate the core concepts of the functional programming. You’ll learn more about immutability, purity, side effects and expressions.
To write modern code in a functional style, you need to learn modern C# features appeared in C# 6 and C# 7.
We’re going to learn more about immutability in a separate section. This is a very important topic.
We’re going to learn how to extend types. You’ll see practical cases, you’ll learn about general extensions needed for functional programming.
After mastering the topic of types extending you will face the great problem of exceptions handling. Yep, it's a hard nut to crack. We will start from discussing a question of why we use exceptions as a mechanism of errors handling. And why C# team didn't invent any other mechanisms?
In the end, we will look at how to fight with null values. As you may know, Tony Hoar said that the invention of a null value was his billion-dollar mistake.
To sum up, the course covers the following topics:
Theoretical Foundations of Functional Programming
Core Concepts of Functional Programming
Functional Features in C#
Immutability in C#
Extendibility in C#
Dealing with Errors
Dealing with Nulls
------------------------------------------------------------
Keywords related to the course:
C# Clean Code
C# Best Practices
Functional Programming in C#
C# Functional Programming
Clean Code in C# tutorial