Do you want to make your application faster, improve performance, and increase your productivity? If yes, then this Learning Path is just what you need.
Packt’s Video Learning Paths are a series of individual video products put together in a logical and stepwise manner such that each video builds on the skills learned in the video before it.
This Learning Path takes a pragmatic approach and shows you advanced techniques and best practices that will help you write better functional constructs in C#. You’ll learn how to apply the functional programming concepts in business scenarios. You will also develop a deep understanding of the concepts and practices of LINQ in C#. After you have a firm grip on the basic concepts, you will learn about asynchronous programming related to functional programming and how to use async and await in C#. You will also be able to write code using the best approach and learn to perform unit testing in functional programming, changing how you approach your application and revolutionizing your projects.
By the end of the Learning Path, you will have a deep understanding of the concepts and practices of functional programming.
About the Author:
For this course, we have combined the best works of this esteemed author:
Wisnu Anggoro is a Microsoft Certified Professional in C# programming and an experienced C/C++ developer. He has also authored Boost.Asio C++ Network Programming - Second Edition, published by Packt Publishing. He has been programming since he was in junior high school and started developing computer applications using the BASIC programming language in the MS-DOS environment. He has a solid experience of smart card programming as well as desktop and web application programming, such as designing, developing, and supporting live use applications for SIM card operating system porting, personalization, PC/SC communication, and other smart card applications that require the use of C# and C/C++. He is currently a senior smart card software engineer at CIPTA, an Indonesian company that specializes in the innovation and technology of smart cards.
In functional programming, we write functions without side effects the way we write in
For the rest of the discussion in this section, we have to create some code in C#. We will use Visual Studio 2015 Community Edition and .NET Framework 4.6.2. But, before getting started, we must know how to define the configuration settings.
We can also distinguish functional programming from imperative programming by the concepts. The core ideas of functional programming are encapsulated in the constructs. Let’s discuss those concepts in this video.
This video will discuss about functional programming in C#. We will be discussing both
Now that we have learnt the concepts of functional programming, we need to learn to transform imperative code to functional code by leveraging method chaining. This video consists of an example where we have to create an HTML-ordered list containing the list of the planetsin our solar system.
So far, we have had to deal with functional programming by creating code using functional
A delegate is a data type in C# that encapsulates a method that has particular parameters and return types. Let’s dig a little deeper into delegate syntax and use to learn how it will define the parameters and the return type of a method.
In C#, not only are we able to declare a delegate, but we are also able to use the built-indelegate from the C# standard library. This built-in delegate also applies to the generic datatype, so let's discuss the generic delegate prior to discussing the built-in delegate.
A generic delegate has the ability to be assigned by a method that has an unmatched signature to the delegate. We can call this variance in delegates. There are two variances indelegates; covariance and contravariance. This video will help us learn them.
In the previous section, we already discussed how to declare a delegate using named methods. When using named methods, we have to create a method first, give it a name, and then associate it with the delegate. Let’s explore how we do that.
We now have an idea that anonymous methods can help us create a simple and short method. However, in C# 3.0, lambda expressions were announced in order to complement anonymous methods in providing a shorthand notation to create anonymous methods. This video will help us know everything related to lambda expressions.
In C#, an object or a class can be used to inform other objects or classes when something happens, which is known as an event. There are two kinds of classes in the event, they are publishers and subscribers. Let’s learn how lambda expressions are used to handle events.
Lambda expressions are not only a powerful way to provide a shorthand notation for anonymous methods, but they are also used in functional programming. In this video, we will go through the advantages of using the lambda expression in the context of functional programming.
An extension method is a capability that can extend the ability of an existing class or type
We have successfully created the IsPalindrome() extension method in the previous
Not only can classes and types apply an extension method, but interfaces, collections, and any other objects can be functionally extended using an extension method as well. This video shows us how to extend interface, collection and object.
Method chaining in functional programming relies on extension methods. As we have already discussed in Section 1, method chaining makes our code easier to read. At the same time, extension method still has some limitations. Let’s take a look at the advantages and limitations of extension method.
Language Integrated Query (LINQ), which was introduced in C# 3.0, is a language feature of the .NET Framework that enables us to query data in collections by easily implementing the IEnumerable<T> interface, such as ArrayList<T>, List<T>, an XML document, and a database. Let’s learn a bit more about LINQ in this video.
LINQ implements a deferred execution concept when we query the data from a collection. This means that the query will not be executed in the constructor time but in the enumeration process instead. This video will discuss deferred execution in detail.
From our discussions in previous videos, we found two types of querying syntaxes so far. Let's discuss them further in this video, by distinguishing these two syntaxes.
There are more than 50 query operators in the Enumerable class included in the System.Linq namespace. They are also known as standard query operators. Let’s take a look at some of them in this video.
As we learnt in the previous video, based on the function of the operators, we can divide them into several operations. This video will show us some more standard query operators in LINQ provided by the .NET Framework.
The first time .NET Framework was announced, the flow of the program was executed sequentially. The drawback of this execution flow is that our application has to wait for the operation to finish before executing the next operation. Let’ see how we can solve this problem.
The asynchronous programming model (APM) is an asynchronous operation that uses the IAsyncResult interface as its design pattern. It's also called the IAsyncResult pattern. With the help of this video, we’ll get to know about asynchronous programming model in detail.
The task-based asynchronous pattern (TAP) is a pattern that's used to represent arbitrary asynchronous operations. The concept of this pattern is to represent asynchronous operations in a method and combine the status of the operation. Let’s learn a bit more about TAP model.
The async and await keywords were announced in C# 5.0 and became the latest things in C# asynchronous programming. This video will help us learn about async, await keywords and asynchronous functions.
Packt has been committed to developer learning since 2004. A lot has changed in software since then - but Packt has remained responsive to these changes, continuing to look forward at the trends and tools defining the way we work and live. And how to put them to work.
With an extensive library of content - more than 4000 books and video courses -Packt's mission is to help developers stay relevant in a rapidly changing world. From new web frameworks and programming languages, to cutting edge data analytics, and DevOps, Packt takes software professionals in every field to what's important to them now.
From skills that will help you to develop and future proof your career to immediate solutions to every day tech challenges, Packt is a go-to resource to make you a better, smarter developer.
Packt Udemy courses continue this tradition, bringing you comprehensive yet concise video courses straight from the experts.