[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] design by contract
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] design by contract |
Date: |
Thu, 12 Dec 2002 13:12:27 +0100 |
User-agent: |
Mutt/1.3.22.1i |
> Though I never quite grokked why "design by contract" would bet better than
> reasonable use of asserts, ...
Not even asserts are really necessary:
def a_func(anArg = None):
if anArg is None:
return false
if not anArg satisfies some other condition:
return false
do_something()
return true
Sort of.
Any conscientious programmer should use this sort of construct
in appropriate places anyways.
But, it makes for overhead in _all_ cases. Which DBC
apparently doesn't.
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346