C#2.0、3.0和4.0中的新功能列表 [英] List of new features in C# 2.0, 3.0 and 4.0

查看:73
本文介绍了C#2.0、3.0和4.0中的新功能列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.NET 1.1项目上工作了很长时间,而我一直停留在C#1.0上,现在我想赶上最新的和最伟大的。

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返回了很多有关C#v2.0中新功能的信息,但是对于版本3和4,我只发现了部分信息。

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.

互联网上列出了v2.0,v3.0和v4.0中C#引入的所有新功能吗?

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

推荐答案

完整插件编写我自己的书,但希望不是免费的:掌握 C#深度学习第二版的早期访问版本 。它跳过了C#1,但是详细介绍了C#2、3和4的每个功能。

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.

如果您只是想要功能列表,请参阅附录C:

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

C#2.0:

C#2的主要功能是泛型,可为空的类型,匿名方法以及其他与委托相关的增强功能和迭代器块。此外,还引入了一些较小的功能:部分类型,静态类,具有针对getter和setter的不同访问修饰符的属性,名称空间别名,pragma指令和固定大小的缓冲区。

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主要是针对LINQ构建的,尽管许多功能在其他地方也很有用。
自动属性,数组和局部变量的隐式键入,对象和
集合初始值设定项以及匿名类型均在XREF ch8章中介绍。
Lambda表达式和表达式树扩展了2.0版中与
委托相关的进展,并且扩展方法为查询表达式提供了最后的要素。部分方法仅在C#3中添加,尽管部分类型本身在C#2中。正如Marc在评论中指出的那样,泛型类型推断在C#3中得到了极大的推动。

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具有一些旨在实现互操作性的功能,但没有相同的
一心一意C#3.0。再次,
的小功能(命名参数,可选的
参数,更好的COM互操作,通用方差)与动态
的巨大功能之间存在合理的清晰区分。

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.

我有 C#2的骗子指南 C#3 的另一个,但我还没有完成C#4但是我很害怕。

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.0、3.0和4.0中的新功能列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆