On Tue, Jan 10, 2006 at 05:44:45PM +0100, Paul Johnson wrote:
>
> This isn't an answer to your question, but in general production is the
> environment in which your code will be exposed to the data and
> conditions which have had the least testing, and to which you will have
> the least access and freedom to change things. This is precisely the
> environment in which I like to have checks to discover problems as early
> as possible and to provide the most information about them.
Absolutely.
> Should you have considered this found that the checks are just too
> expensive
Then you should go back again and prove it beyond any shadow of a doubt with
benchmarks.
Then add assertion guards using
if ($DEBUG) {
.... # Assertion goes here
}
and benchmark again. If they are still too expensive, then you have
bigger problems than assertion checking, notably that your application
is probably written in the wrong language.
> I suppose you could consider a source filter, but I couldn't recommend
> that.
I'd make a slightly stronger statement than that: If you were congenitally
insane, wilfully stupid or drunk, you could consider a source filter for this.
Ben