My Account Log in

3 options

Functional C# : uncover the secrets of functional programming using C# and change the way you approach your applications forever / Wisnu Anggoro.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central College Complete Available online

View online

O'Reilly Online Learning: Academic/Public Library Edition Available online

View online
Format:
Book
Author/Creator:
Anggoro, Wisnu, author.
Language:
English
Subjects (All):
C# (Computer program language).
Functional programming (Computer science).
Physical Description:
1 online resource (365 pages) : color illustrations
Edition:
1st edition
Other Title:
Functional C sharp
Place of Publication:
Birmingham, England ; Mumbai, [India] : Packt, 2016.
System Details:
text file
Biography/History:
Anggoro Wisnu: Wisnu Anggoro is a Microsoft Certified Professional in C# programming and an experienced C/C++ developer. He has also authored the books Boost. Asio C++ Network Programming - Second Edition and Functional C# by Packt. He has been programming since he was in junior high school, which was about 20 years ago, and started developing computer applications using the BASIC programming language in the MS-DOS environment. He has solid experience in smart card programming, as well as desktop and web application programming, including designing, developing, and supporting the use of 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 innovation and technology for smart cards. He can be reached through his email at wisnu@anggoro. net
Summary:
Uncover the secrets of functional programming using C# and change the way you approach your applications forever About This Book This book focuses on the functional paradigm of C#, which will give you a whole new angle on coding with C# It illustrates the advantages that functional programming brings to the table and the associated coding benefits This practical guide covers all the aspects of functional programming and provides solutions that can be applied in business scenarios Who This Book Is For This book is suitable for C# developers with basic prior knowledge of C# and with no functional programming experience at all. What You Will Learn Develop an application using the functional approach Implement unit testing to functionally program code Create efficient code using functional programming Work through a LINQ query so you can work with data Compose asynchronous programs to create a responsive application Use recursion in function programming in order to simplify code Optimize the program code using Laziness and Caching Techniques In Detail Functional programming makes your application faster, improves performance, and increases your productivity. C# code is written at a higher level of abstraction, so that code will be closer to business requirements, abstracting away many low-level implementation details. This book bridges the language gap for C# developers by showing you how to create and consume functional constructs in C#. We also bridge the domain gap by showing how functional constructs can be applied in business scenarios. We'll take you through lambda expressions and extension methods, and help you develop a deep understanding of the concepts and practices of LINQ and recursion in C#. By the end of the book, you will be able to write code using the best approach and will be able to perform unit testing in functional programming, changing how you write your applications and revolutionizing your projects. Style and approach This book takes a pragmatic approach and shows you techniques to write better functional constructs in C#. We'll also show you how these concepts can be applied in business scenarios.
Contents:
Cover
Copyright
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Table of Contents
Preface
Chapter 1: Tasting Functional Style in C#
Introducing functional programming
Understanding definitions, scripts, and sessions
Using substitution and simplification to evaluate the expression
Understanding the functions used for functional programming
Forming the definition
Currying
Comparison between functional and imperative programming
Preparing the C# compiler
Concepts of functional programming
First-class and higher-order functions
Function types
Function values
Pure functions
Recursive functions
Feeling functional in C#
Using mathematical concept to understand functional approach
Applying tuple for functional C#
Currying in C#
Pipelining
Method chaining
Transforming imperative code to functional code
The imperative code approach
The functional code approach
The GenerateOrderedList() method
The Main() method
The advantages and disadvantages of functional programming
Summary
Chapter 2: Walkthrough Delegates
Introducing delegates
Simple delegates
Multicast delegates
Using the Delegate.Combine() and Delegate.Remove() methods
Using += and -= operators
Built-in delegates
Generic delegates
The Action and Func delegates
Distinguishing variance in delegates
Covariance
Contravariance
Chapter 3: Expressing Anonymous Methods with Lambda Expressions
Getting to know anonymous methods
Creating anonymous methods
Using an anonymous method as an argument
Writing anonymous methods - some guidelines
Advantages of the anonymous methods
Lambda expressions
Transforming an anonymous method to a lambda expression.
Creating a delegate type using lambda expresions
Expression trees and lambda expressions
Subscribing for events using lambda expressions
Using the event keyword
Using EventHandler or EventHandler&lt
T&gt
The advantages of using lambda expression in functional programming
First-class functions
Closure
Chapter 4: Extending Object Functionality with Extension Methods
Getting closer to extension methods
Creating an extension method
Extension methods in the code IntelliSense
Calling extension methods in the other assemblies
Referencing a namespace
Piggybacking a namespace
Leveraging the interface, collection, and object
Extending the interface
Extending the collection
Extending an object
Advantages of using extension methods in functional programming
Limitations of the extension method
Extending a static class
Modifying the method implementation in the existing class or type
Chapter 5: Querying Any Collection Easily with LINQ
Getting started with LINQ
Deferring LINQ execution
Choosing between fluent syntax and query expression syntax
Understanding the LINQ fluent syntax
Understanding the LINQ query expression syntax
Enumerating standard query operators
Filtering
Projection
Joining
Ordering
Grouping
The set operation
Conversion methods
Element operation
Chapter 6: Enhancing the Responsiveness of the Functional Program with Asynchronous Programming
Building a responsive application
Running a program synchronously
Applying threads in the program
Creating threads using thread pool
The asynchronous programming model pattern
Using the synchronous Read() method
Using the BeginRead() and EndRead() methods
Adding LINQ to the BeginRead() method invocation.
The task-based asynchronous pattern
Introducing the Task and Task&lt
TResult&gt
classes
Applying a simple TAP model
Using the WhenAll() extension method
Wrapping an APM into a TAP model
Asynchronous programming with the async and await keywords
Asynchronous functions in functional programming
Chapter 7: Learning Recursion
Exploring recursion
Working of the recursive routine
Refactoring an iteration to the recursion
Using tail recursion
Accumulator-passing style
Continuation-passing style
Indirect recursion over direct recursion
Recursion in a functional approach using LINQ Aggregate
Delving into the Aggregate method
Chapter 8: Optimizing the Code using Laziness and Caching Techniques
Introduction to laziness
Lazy enumeration
Lazy evaluation
Nonstrict evaluation
Lazy initialization
The advantages and disadvantages of being lazy
Caching expensive resources
Performing initial computation
Memoization
Chapter 9: Working with Pattern
Dissecting pattern matching in functional programming
Transforming data using pattern matching
Switching for pattern matching
Simplifying pattern matching
Welcoming the coming of pattern matching feature in C# 7
Introducing Monad as a design pattern
Creating the Monadic M&lt
type
Implementing the generic data type to Monad
Implementing Monad to Lazy&lt
and Task&lt
Rules of the Monad pattern
Chapter 10: Taking an Action in C# Functional Programming
Developing functional programming in Windows forms
Creating the code behind a form
Creating the engine code in an imperative approach
Preparing class properties
Constructing the constructor
Clearing the properties
Appending the number to the display box.
Preparing the mathematical operation
Formatting the input
Solving the calculation
Calculating the additional operation
Creating the engine code in the functional approach
Adding several new properties
Simplifying the pattern matching
Assigning the properties
Constructing the class by clearing the properties
Appending the inputted number to the text box
Preparing the operation
Chapter 11: Coding Best Practice and Testing the Functional Code
Coding best practices in functional C#
Preventing dishonest signatures
Refactoring a mutable class into an immutable one
Avoiding mutability and temporal coupling
Dealing with the side-effects
Separating the code from domain logic and mutable shell
Examining the code containing side-effects
Refactoring the AddRecord() method
Refactoring the RemoveRecord() method
Running domain logic in unit testing
Testing the AddRecord() method
Testing the RemoveRecord() method
Executing the test
Adding the mutable shell into code
Index.
Notes:
Includes index.
Description based on online resource; title from PDF title page (ebrary, viewed March 1, 2017).
ISBN:
9781785881039
1785881035
OCLC:
970351895

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account