Generics, delegates and functional programming in C# 2.0

  • Authors:
  • David Naugler

  • Affiliations:
  • Southeast Missouri State University, One University Plaza, Cape Girardeau, MO

  • Venue:
  • Journal of Computing Sciences in Colleges
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Functions are first class objects in functional languages such as Scheme or ML - functions can be passed as parameters, functions can construct and return functions. The functional style of programming that this allows is quite distinct from the style normally used with languages such as Java, C or C++. Delegates in C# allow mimicking important features of functional programming in a rather different way than in Java [3]. C# 2.0 introduces features such as generic classes, generic delegates and anonymous methods which make functional programming even easier and more natural. Generic delegates and anonymous methods are used to model functional programming in C# 2.0. This allows the use of a functional programming style in C# and is a tool for exploring some of the interesting new features of C# from outside the box.