C4Swimmers Newsletter  

(Tutorial) Functional Programming in C# 3.0 using Lambda Expression - Part 1

Tutorial: Functional Programming in C# 3.0 using Lambda Expression - Part 1 

Introduction

C# was born in an object oriented programming family and started evolving to adopt the characteristics from other programming languages as well the functional programming family. It laid its foundation to adopt functional programming since version 1.0 with delegates and some partial adoptions found in C# 2.0. Finally, it smartly adopts functional programming style with OO.

In this article, I will explain how to write programs in a functional manner using C# 3.0. If you are new to functional programming or do not know the benefits of it, read my two part articles, Introduction to Functional Programming using F# Part 1 and Part 2. These articles are mainly focused on explaining the fundamentals and benefits of functional programming and the famous lambda calculus theory.

Factors for Functional Programming Adoption

As I explained in my article, Introduction to Functional Programming using F#, there are eight factors that need to be supported by a programming language for functional programming. There are:

1. Anonymous function name
2. Type inference
3. Parameterized types
4. High order functions
5. Immutable data structure
6. Recursion
7. Currying
8. Lazy evaluation

I am going to explain how C# 3.0 adopts or satisfies these factors with necessary details.

| Read More..

Courtesy: Codeproject.com