基于契约的编程
有人可以解释一下 Spec# 可能会转移到 C# 4.0 中有关代码契约的概念吗?
- 什么是代码契约(看起来是编译时检查模式)
- 我应该对此感到兴奋吗?
- 我假设我们将运行时检查移至编译时是否正确?
谢谢!
Can someone explain the concepts that Spec# might be moving into C# 4.0, regarding Code Contracts?
- What are code contracts (Looks to be a compile time checking pattern)
- should I be excited about this?
- Am I correct in assuming that we move what would be runtime checks to compile time?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我个人是 Bertrand Meyer 的忠实粉丝,他写了这本书,名为 面向对象软件Construction 并创建了一种名为 Eiffel 的语言,该语言支持按合同设计或基于合同的编程。
您可能想观看本系列视频链接
I personally am a big fan of a guy called Bertrand Meyer who wrote this book called Object Oriented Software Contruction and created a language called Eiffel which endoreses Design By Contract or Contract based programming.
You might want to see this series of videos link
以下是直接来自 Microsoft Research 的代码合同的详细描述。 听起来主要好处是:
Here's a good description of code contracts straight from Microsoft Research. It sounds like the main benefits are: