2

I'm working on a LOB framework, with an SL and MVC frontend, WCF backend, and few service modules that run on the server. I've been looking at the Spec#, to see if it helps me in any way. The non-nullable types and the checked exceptions are very good by themselves, but I yet to find any specially good usage for the contracts. What are the pros, cons of using spec#?

Also, does the spec# license mean I cannot use spec# in a project which results in an application being sold to a paying customer?

TDaver
  • 7,164
  • 5
  • 47
  • 94
  • Also see [is-spec-stable-enough-to-use](http://stackoverflow.com/questions/437383/is-spec-stable-enough-to-use) – nawfal Jul 08 '14 at 07:37

1 Answers1

4

Spec# is a research project. If you want similar features for production code you should look into Code Contracts.

Matthew Whited
  • 22,160
  • 4
  • 52
  • 69
  • 1
    But it lacks the two main things I'm looking for: language integrated non-nullable types and checked exceptions! – TDaver Jun 24 '11 at 13:29
  • But it is supported and works for most .Net languages. There are also a few addons for visual studio to make it easier to work with. – Matthew Whited Jun 24 '11 at 13:31
  • 1
    As for checked exceptions... enjoy this... http://www.artima.com/intv/handcuffs.html – Matthew Whited Jun 24 '11 at 13:41
  • One last note, if need checked exceptions you may be "doing it wrong". It is typically better to pre-check your conditions before you get into an exceptional state. This is a place where Code Contracts really comes to light. It is possible to have complex validation rules in your code that will be reported by the compiler if they are violated. This helps to ensure you code is sane before you press `Run` – Matthew Whited Jun 24 '11 at 13:47
  • thanks for the great insight (I may have felt into the "looked great from afar" issue on the checked exceptions) – TDaver Jun 24 '11 at 13:57