Print Page | Close Window

Code Contracts

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4175
Printed Date: 23-Apr-2024 at 3:58am


Topic: Code Contracts
Posted By: gregweb
Subject: Code Contracts
Date 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



Replies:
Posted By: mgood
Date 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.


Posted By: gregweb
Date Posted: 12-Jun-2013 at 3:00pm
OK, thanks Marcel.



Print Page | Close Window