C# 4.0 的新酷特性 [英] New Cool Features of C# 4.0

查看:42
本文介绍了C# 4.0 的新酷特性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你们正在寻找或听说在 c# 4.0 中发布的最酷的新功能是什么.

What are the coolest new features that you guys are looking for, or that you've heard are releasing in c# 4.0.

推荐答案

动态的东西听起来很酷如果你需要它但我不希望经常使用它.

The dynamic stuff sounds cool if you need it but I don't expect to use it very often.

委托和接口的通用差异是相似的 - 缺乏差异是目前令人头疼的问题,但 C# 4 中可用的有限差异无法涵盖许多令人头疼的地方.

The generic variance for delegates and interfaces is similar - the lack of variance is a headache at the moment, but many of the places where it's a pain won't be covered by the limited variance available in C# 4.

我对 COM 功能并不特别感兴趣 - 但我真的应该更多地了解它们.

The COM features don't particularly interest me - I really ought to get more of a handle on what they are though.

可选参数和命名参数在构建不可变类型时可能会产生很大的不同:它启用如下语法:

Optional and named parameters could make a big difference when building immutable types: it enables syntax like:

Person p = new Person (name: "Jon", age: 32);

没有构造函数重载的庞大组合.我更喜欢以只读自动实现的属性的形式编写不可变类型的更多支持,但我不希望我们会得到这些.(它们目前当然不在提议的功能列表中.)

without having mammoth combinations of constructor overloads. I'd prefer a bit more support for writing immutable types in the form of readonly automatically implemented properties, but I don't expect we'll get those. (They certainly aren't in the proposed feature list at the moment.)

我个人实际上对 .NET 4.0 的几个框架功能更感兴趣 - 特别是 代码合同并行扩展.

I'm personally actually more interested in a couple of the framework features of .NET 4.0 - in particular code contracts and parallel extensions.

这篇关于C# 4.0 的新酷特性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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