Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Jul 2001 23:35:01 -0700
From:      Dima Dorfman <dima@unixfreak.org>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libutil ecalloc.c emalloc.3 emalloc.c erealloc.c estrdup.c Makefile libutil.h 
Message-ID:  <20010723063501.D2E223E28@bazooka.unixfreak.org>
In-Reply-To: <200107230223.f6N2Nfg14201@hak.lan.Awfulhak.org>; from brian@Awfulhak.org on "Mon, 23 Jul 2001 03:23:41 %2B0100"

next in thread | previous in thread | raw e-mail | index | archive | help
Brian Somers <brian@Awfulhak.org> writes:
> So we disagree.  You believe these short functions bring consistency 
> to our code.  I believe that they obscure things and make them less 
> portable.
> 
> If anybody else wishes to chime in and express an opinion, now's a 
> good time.  I've said my piece and won't push this any further unless 
> concensus says I should.

Well, since you asked...

I think functions such as these are useful for writing scratch
programs where the only reason you want to check for errors is so if
something goes wrong, you can tell the difference between a failed
system call (or memory allocation) and a logic bug in your program.
Stevens, W. Richard, uses functions like these (albeit with different
names) in most (all?) the examples in his books.  It does a lot to
make the code more readable, but it's code that's being presented as
an example, not for production use.

In other words, a library with these kinds of functions would be
useful as a port for consumption by people writing scratch programs
which will never see the light of day.  They certainly shouldn't be
used in any production-quality programs, such as those found in our
source tree.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010723063501.D2E223E28>