10

Code contracts was all over the blogosphere years ago before the .NET 4 release, the runtime components included in .NET 4 and the static checker made available in the more expensive Visual Studio 2010 editions.

The buzz around code contracts appear to have died down though, are people using it in production? Is any more work being done on it from Microsoft Research?

Martin Liversage
  • 104,481
  • 22
  • 209
  • 256
SoftMemes
  • 5,602
  • 4
  • 32
  • 61

2 Answers2

7

Looking at the project page, the last release was June 2nd 2011 - which seems pretty recent to me.

So yes, I think it's still being worked on. Will it ever make significant inroads into the average code shop? It's too early to tell. Occasionally I see Stack Overflow questions on it, suggesting it's still in use in some places - but I haven't seen as much evidence of take-up as I'd really have liked.

I suspect it's one of those tools which is really useful in some situations, and a bit of a pain in others - and also much more useful in greenfield projects than brownfield ones.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • Another downside is that even they mentioned it would not require the external installer for the small library; that it would be included in Visual Studio 2010 and .NET 4, but that didn't happen. You still have to download the package from devlabs and install it otherwise you don't get the Code Contracts tab added to your .NET4 projects in Visual Studio. Not a big issue, but yet another dependency package to worry about installing on your machine. – David Anderson Jan 03 '12 at 11:20
  • So it's been about a year since this was asked and Code Contracts still seems to be actively developed (last release March 27, 2012), but I'm disappointed it's not included with VS 2012 or even talked about much these days. Any insight as to why not and when/if it will be productized like Moles was? – Scott Lerch Jul 16 '12 at 05:03
  • @ScottLerch: No such insight from me, I'm afraid :( – Jon Skeet Jul 16 '12 at 05:48
0

It's still being used within the .NET Framework itself (at least as of 4.51). For an example, take a look at the implementation of the System.Text.StringBuilder class.

Dave Black
  • 7,305
  • 2
  • 52
  • 41