Chapter 2. What Can We Do Already?
Some of the code and concepts discussed in this chapter may seem trivial to some, but bear with me. I don’t want to introduce too much too soon. More experienced developers might like to skip ahead to Chapter 3, in which I talk about the more recent developments in C# for functional programmers, or Chapter 4, where I demonstrate some novel ways to use features you might already be familiar with to achieve some functional features.
This chapter presents the FP features that are possible in just about every C# codebase in use in production today. I’m going to assume at least .NET Framework 3.5, and with some minor alterations, all the code samples provided in this chapter will work in that environment. Even if you work in a more recent version of .NET but are unfamiliar with FP, I still recommend reading this chapter, as it should give you a decent starting point in programming with the functional paradigm.
Those of you familiar with functional code, who just want to see what’s available in the latest versions of .NET, might benefit from skipping ahead to the next chapter.
Getting Started
FP is easy, really it is! Despite what many people think, it’s easier to learn than OOP. FP has fewer new concepts to learn.
If you don’t believe me, try explaining polymorphism to a nontechnical member of your family! Those of us who are comfortable with object orientation have often been doing it so long that we’ve forgotten how hard it may have been to get ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access