New Posts New Posts RSS Feed: Code Contracts
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Code Contracts

 Post Reply Post Reply
Author
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Topic: Code Contracts
    Posted: 12-Jun-2013 at 5:49am
I have recently been reading up on Code Contracts, ala Contract By Design. It seems like a good idea, but I have yet to see Contract.Requires and Contract.Ensure in production code, for example, in TempHire or Cocktail.

Just wondering what your take on it is.

Greg
Back to Top
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jun-2013 at 10:30am
I haven't seen it used widely myself and personally I haven't really spent time on it. On the surface it does look like a good idea and might be something useful in particular for libraries such as Cocktail to check things at runtime and ensure the caller is using the APIs correctly.

More importantly than contracts are good unit tests, though, in my opinion.
Back to Top
gregweb View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 10-Sep-2009
Location: Clearwater, Fl
Posts: 253
Post Options Post Options   Quote gregweb Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jun-2013 at 3:00pm
OK, thanks Marcel.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down