Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!snorkelwacker.mit.edu!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.bugs.sys5 Subject: Re: Shell Scripts v. Command Options (was: Re: small bug in who(1) of SVR3) Message-ID: <29979:Jan2113:48:3191@kramden.acf.nyu.edu> Date: 21 Jan 91 13:48:31 GMT References: <1991Jan16.175908.3338@zoo.toronto.edu> <1396:Jan1811:54:2091@kramden.acf.nyu.edu> <4581@lib.tmc.edu> Organization: IR Lines: 37 In article <4581@lib.tmc.edu> jmaynard@thesis1.hsch.utexas.edu (Jay Maynard) writes: > In article <1396:Jan1811:54:2091@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > >In article <1991Jan16.175908.3338@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: > >> I don't advocate callous disregard for efficiency -- that way lies GNU > >> Emacs and other excesses -- but a sense of perspective is needed. Hacking > >> C code to avoid writing a one-line shell script is a gross waste of time > >> and money unless that program is truly critical to system performance. > (Henry, that first sentence would normally be .sigfile material. Bravo!) Hmmm. Up to the second dash, or the whole sentence? It'll only fit up to ``Emacs'' on one line (or two half-lines). > >That depends on your user community. In general, code that will be > >distributed to thousands of sites should be written efficiently. > For heaven's sake, why? I just gave several colleagues a good laugh by taking that response out of context. ``What is he trying to do, sell code to the government?'' The answer is ``To save as much computer time around the world as possible.'' If you waste a second on a program run ten times every day at thousands of sites, you waste thousands of hours of computer time every year. Is that really worth the five minutes that it takes to write ``users'' in C instead of sh? You're going to waste five minutes writing the documentation anyway. > There's a tradeoff there, and the most effort towards > efficiency is best concentrated on those parts of the system where it makes a > significant difference. I agree entirely. Read what I said again: Code that will be distributed to thousands of sites should be written efficiently. If a shell script is (for all practical purposes) just as efficient as a C program, then there's no problem. But utmp checkers are so easy to write in any language that there's no point using anything but C. ---Dan