Static typing, Python, D, DbC

Paul Rubin no.email at nospam.invalid
Mon Sep 13 17:05:43 CEST 2010


Bearophile <bearophileHUGS at lycos.com> writes:
> But in some situations you want a faster final program. Running the
> run-time contracts only when you test the code and removing them when
> you run the program for real sounds silly or dangerous. But life is
> made of trade-offs, and running those contracts during testing is
> better than _never_ running them. 

For some programs, having the contracts fail during running "for real"
is intolerable, so if you're not ready to remove the runtime tests, then
program is not ready to run for real.

The Wikipedia article about DBC

   http://en.wikipedia.org/wiki/Design_by_contract

makes it sound like what I thought, the preferred enforcement method is
static, but runtime testing can be used as a fallback.  I'm pretty sure
Eiffel itself comes with static DBC tools.



More information about the Python-list mailing list