Tool -flag considered harmful (was: grep replacement)

Root Boy Jim rbj at ICST-CMR.ARPA
Thu Jun 16 08:05:54 AEST 1988


? From: "Bruce G. Barnett" <barnett at vdsvax.steinmetz.ge.com>

Everything you said that I deleted I agree with totally.

? If diff loses the -c (context) option, I have to be familiar with
? two commands instead of one. One being diff, one being context diff.
? Why should I have to know about two different commands that do the
? same thing - compare two files?

Not only that, but as features are added to one program, they will
not be necessarily added to the other. Regression testing of two
programs will be more difficult than one. Most likely the two programs
will also consume more disk space as well.

? Flame me if you will, but when I use these tools in an interactive
? session, I don't care if 'cat -v' is slow. Or 'diff -c'. Or grep -whatever.

While we're on the subject of efficiency, cmp is coded wrong. It should
first stat the two files to be compared. If the character count is different,
so are the files. And files tend to be different more often than the same.

Cmp also takes (BSD cmp at least) third and fourth numeric arguments;
the offsets within the file to start comparing at. They could be easily
figured into the above computation. This would often save a lot of time.

? 	Bruce G. Barnett 	<barnett at ge-crd.ARPA> <barnett at steinmetz.UUCP>
? 				uunet!steinmetz!barnett
 
	(Root Boy) Jim Cottrell	<rbj at icst-cmr.arpa>
	National Bureau of Standards
	Flamer's Hotline: (301) 975-5688
	The opinions expressed are solely my own
	and do not reflect NBS policy or agreement
	My name is in /usr/dict/words. Is yours?



More information about the Comp.unix.wizards mailing list