开发者

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

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. 开发者_如何转开发 Closed 9 years ago.

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?


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.


C# 2: MSDN, Wikipedia

C# 3: MSDN, Wikipedia, Stackoverflow

C# 4: MSDN, Wikipedia, Stackoverflow


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.


  • C# 3.0:

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

  • C# 4.0
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜