If you ever used a 3rd party API, you surely know the importance of proper documentation – Can this method return “null”? Do I have to check this return value? What are the valid values of this argument? You also probably know that the only way to discover if your assumptions are correct is to execute the code and pray that exceptions won’t be flying around. There must be a better way!
Enter “Code Contracts”. Code Contracts is an experimental project from Microsoft Research which provides a language-agnostic way to express coding assumptions in .NET programs, thus allowing for improved testability, static verification at compile time and automatic API documentation.
On Wednesday, March 20th 2013, I’ll give a presentation on Code Contracts at the Israeli .NET User Group (Microsoft Israel, Ra’anana). In this session we’ll take a tour around Code Contracts, understand when and how we can use them, and show how correct usage of these constructs can significantly increase the quality of your code. In that same event, I’ll also give a session about WF 4.5 so it’s worth coming.
Details and registration can be found here –
See you there!