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 2
Implement Add Book
We will demonstrate a feature with some logic and a side effect: Add Book. The logic is how we put together a book from user input and how we validate the year. We’ll explicitly code the side effects as part of our logic class (Add) and push them out in the next video. - Declare and implement the Add method together with its side effects - Add a menu item for Add - Run the code to demonstrate a persistent Add