DBC as a solution to the final/virtual debate

There has been debate about whether it is better to have methods final by default (like in C#) or virtual by default (like in Java, Python, Ruby, etc.). I’m in the virtual camp, but Elliotte Harold makes some good arguments for design by contract as the better solution, really. It gives paranoid framework designers the control they want (the final camp), yet users aren’t overly restricted in what they can do.

Update: Here is a great video explaining how DBC works using the Spec# language.

Posted in programming

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 4,346 other followers

%d bloggers like this: