FlySwat
FlySwat

Reputation: 175633

Contract based Programming

Can someone explain the concepts that Spec# might be moving into C# 4.0, regarding Code Contracts?

Thanks!

Upvotes: 4

Views: 781

Answers (2)

Perpetualcoder
Perpetualcoder

Reputation: 13571

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.

  1. Code Contract is a kind of agreement between 2 software entities that may or may not interact. More or less like interfaces but more precise.
  2. I am not sure if everyone should or would be excited about this.
  3. Your assumption is somewhat correct.

You might want to see this series of videos link

Upvotes: 3

Marc Novakowski
Marc Novakowski

Reputation: 45398

Here's a good description of code contracts straight from Microsoft Research. It sounds like the main benefits are:

  • Improved testability
  • Static verification
  • API documentation (in code)

Upvotes: 2

Related Questions