🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #302

Re: Complexity of reallocating storage

#302
From: Kevin Braunsdorf
Date: Mon, 04 Feb 1991 23:13
47 lines
2097 bytes
In article <29778:Feb419:26:3791@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>Be serious. Time, space, and human effort are by far the most important
>three factors in programming. 


Yeah, the time and space I have to spend tracking down sloppy code that:
	(a) has no error checks
	(b) doesn't identify itself
	(c) outputs the *wrong* error string...

The *small* time it takes to type in
	if (0 != chdir(acTo)) {
		fprintf(stderr, "%s: chdir: %s: %s\n", progname, acTo, strerror(errno));
		exit(9);
	}

(which is a macro in vi, like:

	map! ^F fprintf(stderr, "%s: ;: %s: %s\n", progname, ;, strerror(errno));^[F;
 or:
	map! ^P fprintf(stderr, "%s: ;: %s\n", progname, strerror(errno));^[F;
)

is better than either
	(void)chdir(acTo);

or
	if (-1 == chdir(acTo)) {
		perror("chdir");
		exit(1);
	}

the second one is the one that really pisses me off.  With a little more care
the program could lead off with a *name* so long pipes wouldn't be so hard
to debug under the UNIX shell.


Yeah, Dan, the time I care about is not the first coder, it is the
maintainer (most of the time is spent in maintaining a system), and
the user writting his first pipeline (who thinks:
	chdir: Not a typewriter
is not a great error message, and thinks all of UNIX is cryptic).


--
"We'll crash and burn, it's hard to look away!!"
kayessbee, Kevin Braunsdorf, ksb@cc.purdue.edu, pur-ee!ksb, purdu!ksb
Technical Details
Message-ID: <5173@mentor.cc.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!sdd.hp.com!news.cs.indiana.edu!noose.ecn.purdue.edu!mentor.cc.purdue.edu!nostromo.cc.purdue.edu!ksb
References: <5883:Feb102:05:4991@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!elroy.jpl.nasa.gov!sdd.hp.com!news.cs.indiana.edu!noose.ecn.purdue.edu!mentor.cc.purdue.edu!nostromo.cc.purdue.edu!ksb
From: ksb@nostromo.cc.purdue.edu (Kevin Braunsdorf)
Newsgroups: comp.bugs.4bsd,comp.lang.c
Subject: Re: Complexity of reallocating storage
Summary: maintainance time is more than you will spend, anyway.
Message-ID: <5173@mentor.cc.purdue.edu>
Date: 4 Feb 91 23:13:07 GMT
References: <5883:Feb102:05:4991@kramden.acf.nyu.edu>
Sender: news@mentor.cc.purdue.edu
Followup-To: comp.bugs.4bsd
Organization: PUCC UNIX Group
Lines: 47