spec#: a framework I can get behind

I’m generally not in favour of frameworks. I think that what the world needs is less frameworks to help programmers be productive. A competing API is one thing, but so many people offering competing paradigms make things hard. And no community traction means that things only ever get to “alpha” quality. And let’s be honest, most of them are unecessary; replacing tricky to understand code with tricky to understand config files to set up your abstract factory-factory? That isn’t progress, that is being an architecture astronaut.

But spec# from microsoft is an exception.

For one, you need something like it, even if you don’t think you do. Programming by contract is good stuff. If you roll your own by having a coding standard that checks validity of parameters and throws known exceptions or sort of attribute decoration on the properties of parameter objects then that is great. But you could do it with a framework like spec#.

For two, this is real framework territory. This stuff can be used on maybe 50% of all code that you write. Ok, not every method on every class needs to have a contract, but anything that you start to reuse would benefit and anything that you start thinking of a library or a common class needs it.

For three, this isn’t some fly-by-night on sourceforge where some CS student has checked in their year end project thinking “when I apply to Google I can show them this and they’ll love me” this is Microsoft. And looking at the dates on the Spec# page they have been at this a long time. Since 2004? My goodness, whole OSs have come and gone in that time!

2 thoughts on “spec#: a framework I can get behind”

  1. Ah. That is a fair comment. The language is already very large and adding to the *language* rather than adding new libraries is maybe not a great idea.

    The question is, are enough people after programming by contract and declared exceptions? If so, maybe there is a way to implement them without adding to the language. Perhaps using attributes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s