Search code examples
c#c#-4.0code-contracts

Books on Code Contracts in C# 4.0


Altough I've known Code Contracts for some time, as I've used it a bit in Java, I would like to start using them in C#, now that they are part of C# 4.0.

I am looking on learning material, books or vids. Altough tutorials are also welcome, I'd like to have something comprehensive to read, not the typical "here's how you use Requires and here's how you use Ensures". I am looking for something that really stands out in this area.

Thanks


Solution

  • Jon Skeet has an entire chapter dedicated to them in the 2nd edition of C# in Depth. It's roughly 40 pages based on the last MEAP update. This isn't final since, as Joel mentioned, it's not out yet, but you could buy it and get access to the MEAP releases: http://www.manning.com/skeet2/

    C# 4.0 in a Nutshell covers it in Ch. 13, "Diagnostics and Code Contracts." Based on the chapter headings in the table of contents I estimate ~17 pages on the topic.

    I imagine Andrew Troelsen's Pro C# 2010 and the .NET 4 Platform book will cover it, but I wasn't able to find a TOC for it.