List of new features in C# 2.0, 3.0 and 4.0

22,945

Solution 1

Complete plug for my own book, but hopefully not gratuitous: get hold of the early access version of the second edition of C# in Depth. It skips C# 1, but goes into detail on every feature of C# 2, 3 and 4.

If you just want a list of features though, from appendix C:

C# 2.0:

The major features of C# 2 were generics, nullable types, anonymous methods and other delegate-related enhancements and iterator blocks. Additionally, several smaller features were introduced: partial types, static classes, properties with different access modifiers for getters and setters, namespace aliases, pragma directives and fixed-sized buffers.

C# 3.0:

C# 3 primarily built towards LINQ, although many features are useful elsewhere. Automatic properties, implicit typing of arrays and local variables, object and collection initializers and anonymous types are all covered in chapter XREF ch8 . Lambda expressions and expression trees extended the delegate-related progress made in version 2.0, and extension methods provided the last ingredient for query expressions. Partial methods were only added in C# 3, although partial types themselves were in C# 2. As Marc points out in the comments, generic type inference received a considerable boost in C# 3.

C# 4.0:

C# 4.0 has some features aimed at interoperability, but doesn't have the same single-mindedness of C# 3.0. Again there's a reasonably clear divide between the "small" features (named arguments, optional parameters, better COM interop, generic variance) and the huge feature of dynamic typing.

I've got a "bluffers guide" for C# 2 and another for C# 3, but I haven't done the equivalent for C# 4 yet I'm afraid.

Solution 2

C# 2: MSDN, Wikipedia

C# 3: MSDN, Wikipedia, Stackoverflow

C# 4: MSDN, Wikipedia, Stackoverflow

Solution 3

The biggest change from 1.1 to 2.0 (IMO) was the introduction of generics. Generics are also a basis for many other .NET technologies since 2.0. I would suggest that you begin your studies with really getting to understand generics very well.

Solution 4

  • C# 3.0:

Implicitly typed local variables
Anonymous types
Extension methods
Object and collection initializers
Lambda expressions
Query expressions
Expression Trees

Share:
22,945
user1609085
Author by

user1609085

Updated on October 24, 2020

Comments

  • user1609085
    user1609085 over 3 years

    I worked on the .NET 1.1 project for a long time, and I was stuck at C# 1.0 and now I would like to catch up with the latest and greatest.

    Google returned a lot of information on new features in C# v2.0, but for the versions 3 and 4 I found only partial information.

    Is there somewhere on the Internet some list of all new features introduced in C# in v2.0, v3.0 and v4.0?