Book Image

Hands-On Functional C# [Video]

By : Georgi Parlakov
Book Image

Hands-On Functional C# [Video]

By: Georgi Parlakov

Overview of this book

<p>When C# programs get more complex, they become hard to understand, and as a result are much harder to maintain. We suggest a few approaches from Functional Programming to resolve this and make the code readable, reusable, testable and structured.</p> <p><span id="description" class="sugar_field">This course will present some basic Functional Programming ideas and suggest how to make use of the functional features of C# in your everyday work. As C# is deeply object-oriented by design, we'll concentrate on the bits of Functional Programming that are easily applicable to it—such as LINQ, pure functions, and dot-chaining (aka composability). We won't explore functional terms such as monads and functors in too much detail; rather we provide examples of real C# using functional features. You'll improve the maintainability and testability of your application and gain the confidence to start a new project with Functional Programming paradigms.</span></p> <p><span id="description" class="sugar_field">All the code and supporting files for this course are available at: <a style="font-weight: normal;" href="https://github.com/PacktPublishing/Hands-on-Functional-C-sharp" target="_new">https://github.com/PacktPublishing/Hands-on-Functional-C-sharp</a></span></p> <h1>Style and Approach</h1> <p>A comprehensive course packed with practical examples and helpful advice on getting started with exploring different Functional Programming features in C#. This course is divided into clear chunks so you can learn at your own pace and focus on your own area of interest.</p>
Table of Contents (7 chapters)
Chapter 6
Isolating the Side Effects
Content Locked
Section 3
Push Side Effects Out
We will consider how easy to test that is and how easy to change the form of persistence would be. We’ll then try and push the side effects out of our logic by accepting functions as dependencies, which will do what our Add.Book method needs in order to do its job. - Revisit the Add method and demo its tight coupling with IO and persistence - Replace the Side effect methods with function parameters: Func and Action - Summarize why side effects are required and need to be on the edge of our systems