code合同,你会使用它们呢?你会、合同、code

2023-09-04 23:46:42 作者:晚安晚安安入我心°

微软刚刚发布了 code合同的,一个工具,集成了Visual Studio和允许您定义合约的净code和获得运行时的和的编译时检查。

Microsoft just released Code Contracts, a tool that integrates with Visual Studio and allows you to define contracts for your .Net code and get runtime and compile time checking.

观看视频频道9 ,显示它被如何使用。

Watch the video on Channel 9 that shows how it being used.

现在它是一个附加的,但它会在.NET 4.0中的基类库的一部分

For now it's an add-on but it will be part of the Base Class Library in .Net 4.0

这是不是你看到自己使用?

Is this something you see yourself using?

我不知道这意味着规格#死亡?

I wonder if this means the death of Spec#?

更新

我的意思的规格#的死亡是,我们现在有2个不同的项目写入合同: 规格#是C#的演进,它引入了新的关键字和行为;另一方面,微软刚刚发布的是,可以与任何.NET语言中使用的库。 由于后者看起来像它会成为事实上的标准,我不知道在那里留下规格#

What I mean by the death of Spec# is that we now have 2 different projects for writing contracts: Spec# is an evolution of C# and it introduces new keywords and behaviours; on the other hand, what Microsoft just released is a library that can be used with any .Net language. Since the latter looks like it's going to become the de-facto standard, I wonder where that leaves Spec#

推荐答案

我想创建计划公开给任何人一个库时,大部分使用C#4.0将使用他们自己的开发列入特别。它可以让你的code更详细的领域,但它的优点应该超过了code和花费的时间线。

I think the majority of developers using c# 4.0 will use them myself included especially when creating a library that you plan to expose to anyone. It may make your code more verbose in areas but the advantages it has should outweigh the lines of code and time spent.