[Python-ideas] Why is design-by-contracts not widely adopted?

Stephen J. Turnbull turnbull.stephen.fw at u.tsukuba.ac.jp
Wed Sep 26 23:48:45 EDT 2018

Robert Collins writes:

 > I think the underlying problem is that you're treating this as a
 > logic problem (what does logic say applies here), rather than an
 > engineering problem (what can we measure and what does it tell us
 > about whats going on).

Pure gold.  I'm glad your name is "Robert Collins", or I would have
skipped the post and just muted the thread.

 > My suspicion, for which I have only anecdata, is that its really in c)
 > today. Kind of where TDD was in the early 2000's (and as I understand
 > the research, its been shown to be a wash: you do get more tests than
 > test-last or test-during,

That's a pretty big deal though, if it means the shop doesn't need The
Big Nurse to prod you to write more tests.

 > and more tests is correlated with quality and ease of evolution,
 > but if you add that test coverage in test-during or test-last, you
 > end up with the same benefits).

"No Silver Bullet." QED

I think Watts Humphrey should have titled his classic, "Any Discipline
for Software Engineering", and subtitled it "'Whatever' Works, as Long
as You Actually Do It".[1]  All of his books on the practice of
software engineering really do say that, by the way.  He recommends
*starting* with *his* way because it worked for him and many students,
so you can just follow the cookbook until "actually doing" becomes
natural.  Then change to doing what comes more naturally to you.

[1]  Fred Brooks would have done that, I think.  Humphrey was way too
stuffy to do that. :-)

More information about the Python-ideas mailing list