Complexity of reallocating storage

Kevin Braunsdorf ksb at nostromo.cc.purdue.edu
Tue Feb 5 10:13:07 AEST 1991


In article <29778:Feb419:26:3791 at kramden.acf.nyu.edu> brnstnd at 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 at cc.purdue.edu, pur-ee!ksb, purdu!ksb



More information about the Comp.lang.c mailing list