Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does .NET 4.0's design by contract compare to Eiffel?

I had the "pleasure" to be taught Eiffel at college by none other than Bertrand Meyer himself and just read that .NET 4.0 will include design by contract.

Can anyone with some insight elaborate on how powerful this will be compared to Eiffel's existing feature set?

Will contracts for interfaces be supported?

like image 841
kitsune Avatar asked Jun 16 '09 18:06

kitsune


2 Answers

Not having ever used Eiffel I can't comment on the comparison, but I have messed around with Spec#, which has design by contract and is what is (mostly) being rolled into C# 4.0, and I can say this:

It's pretty darn powerful.

like image 74
Randolpho Avatar answered Nov 16 '22 04:11

Randolpho


It allows you to specify "design-time asserts" and the compiler will warn you that you might violate the constraint.

Here's a blog post that explains it a little, with a link to a Channel9 detailed explanation.

like image 34
gbjbaanb Avatar answered Nov 16 '22 03:11

gbjbaanb