Saturday, January 30, 2010

Overview of C# 3.0

C# 3.0 ("C# Orcas") introduces several language extensions that build on C# 2.0 to support the creation and use of higher order, functional style class libraries. The extensions enable construction of compositional APIs that have equal expressive power of query languages in domains such as relational databases and XML. The extensions include:
  • Implicitly typed local variables, which permit the type of local variables to be inferred from the expressions used to initialize them.
  • Extension methods, which make it possible to extend existing types and constructed types with additional methods.
  • Lambda expressions, an evolution of anonymous methods that provides improved type inference and conversions to both delegate types and expression trees.
  • Object initializers, which ease construction and initialization of objects.
  • Anonymous types, which are tuple types automatically inferred and created from object initializers.
  • Implicitly typed arrays, a form of array creation and initialization that infers the element type of the array from an array initializer.
  • Query expressions, which provide a language integrated syntax for queries that is similar to relational and hierarchical query languages such as SQL and XQuery.
  • Expression trees, which permit lambda expressions to be represented as data (expression trees) instead of as code (delegates).

No comments:

Post a Comment