Book description
After decades of relative obscurity, functional programming is finally coming into its own. With concise, easy-to-read code that supports asynchronous, concurrent processing, aspects of functional programming have begun to appear in several traditionally object-oriented languages such as C# and Java. This practical book shows C# programmers how to use functional programming features without having to navigate an entirely new language.
Because of the shared runtime environment common to C# and F# languages, it's possible to use most of F#'s functional features in C# as well. Author Simon J. Painter explains how you can write functional code in C# right away, without having to install dependencies or features newer than .NET 3. You'll learn why functional programming concepts can bring immediate benefit to your work.
- Learn what functional programming is and how it originated
- Discover features of the functional paradigm using a more familiar language
- Start coding functionally in C# right away, without relying on third-party libraries
- Write code that's more robust, less error prone, and easier to test
- Examine less conventional ways to look at structures available in C#
- Explore the practicalities of using functional C# in a business environment
Publisher resources
Table of contents
- Preface
-
1. Introduction
- What Is Functional Programming?
- Baking Cakes
- Where Does Functional Programming Come From?
- Who Else Does Functional Programming?
- The Benefits of Functional Programming
- The Best Places to Use Functional Programming
- Where You Should Consider Using Other Paradigms
- How Far Can We Take This?
- Monads Actually, Don’t Worry About This Yet
- Summary
- I. What Are We Already Doing?
- 2. What Can We Do Already?
- 3. Functional Coding in C# 7 and Beyond
- 4. Work Smart, Not Hard with Functional Code
- II. Into the Belly of the Functional
- 5. Higher-Order Functions
- 6. Discriminated Unions
- 7. Functional Flow
- 8. Currying and Partial Application
- 9. Indefinite Loops
- 10. Memoization
- III. And Out the Other Side
-
11. Practical Functional C#
- Functional C# and Performance
- What Does All of This Mean?
-
Functional C# Concerns and Questions
- How Functional Should I Make My Codebase?
- How Should I Structure a Functional C# Solution?
- How Do I Share My Functional Methods Among Applications?
- Did You Order This Pizza?
- How Do I Convince My Teammates to Do This Too?
- Is It Worth Including F# Projects in My Solution?
- Will Functional Coding Solve All My Problems?
- Connery, Moore, or Craig?
- How Do I Think Through a Problem Functionally?
- What If There’s No Way to Make a Bit of Code as High-Performant as I’d Like with Functional-Style Code?
- Summary
- 12. Existing Functional Programming Libraries in NuGet
- 13. The Martian Trail
- 14. Conclusion
- Index
- About the Author
Product information
- Title: Functional Programming with C#
- Author(s):
- Release date: September 2023
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781492097075
You might also like
book
Functional Programming in C#
Functional Programming in C# teaches you to apply functional thinking to real-world problems using the C# …
book
Functional Programming in C#, Second Edition
Real world examples and practical techniques for functional programming in C# without the jargon and theory. …
book
Hands-On Functional Programming with TypeScript
Discover the power of functional programming, lazy evaluation, monads, concurrency, and immutability to create succinct and …
book
Learning Functional Programming
Learn how to think and write code like a functional programmer. With this practical guide, software …