Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Contracts, will you use them?

Microsoft just released Code Contracts, a tool that integrates with Visual Studio and allows you to define contracts for your .Net code and get runtime and compile time checking.

Watch the video on Channel 9 that shows how it being used.

For now it's an add-on but it will be part of the Base Class Library in .Net 4.0

Is this something you see yourself using?

I wonder if this means the death of Spec#?

Update

What I mean by the death of Spec# is that we now have 2 different projects for writing contracts:
Spec# is an evolution of C# and it introduces new keywords and behaviours; on the other hand, what Microsoft just released is a library that can be used with any .Net language.
Since the latter looks like it's going to become the de-facto standard, I wonder where that leaves Spec#

like image 771
Renaud Bompuis Avatar asked Feb 25 '09 03:02

Renaud Bompuis


2 Answers

I think the majority of developers using c# 4.0 will use them myself included especially when creating a library that you plan to expose to anyone. It may make your code more verbose in areas but the advantages it has should outweigh the lines of code and time spent.

like image 56
Quintin Robinson Avatar answered Sep 29 '22 04:09

Quintin Robinson


What do you mean, the death of Spec#? It's the next evolution of Spec#.

And, yes, I plan to use them.

like image 25
Randolpho Avatar answered Sep 29 '22 04:09

Randolpho