[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: abort or verify?

From: Mark Benedetto King <mbk_at_lowlatency.com>
Date: 2004-11-10 17:16:01 CET

On Wed, Nov 10, 2004 at 10:54:57AM -0500, Greg Hudson wrote:
> On Wed, 2004-11-10 at 10:58, Mark Benedetto King wrote:
> > I believe that we should always have code of the form:
> >
> > assert(!blah);
> > if (blah)
> > {
> > /* do some reasonable thing */
> > }
>
> I certainly hope each assertion doesn't turn into three or four lines of
> code.
>

The last four lines could be omitted when the following code
already does some reasonable thing.

Note that I am not taking a position on what "the right thing" is
when someone violates your API (e.g., passes you a NULL even though
your docstring tells them not to).

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Nov 10 17:14:25 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.