1
0
Files
irix-657m-src/eoe/cmd/bru/doc/notes/featurisms
2022-09-29 17:59:04 +03:00

59 lines
2.3 KiB
Plaintext

Many people have noted that utilities tend to suffer what might be
called "creeping featurisms". That is, should a given utility be
made to do "one more thing" by adding a new feature, or should some
way be found to use existing utilities to accomplish the same end.
One of the better features of the UNIX operating system is the ability
to use existing tools to build new tools. There is a lot to be said
for the philosophy of "keep it simple". With respect to bru, it is
true that some of bru's features could be implemented by using bru
in combination with other utilities. For example:
The selection of files owned by a given user, or modified
since the last backup, could be implemented by using
the "find" command and piping the list of files to
bru.
The swap bytes/half-words feature could be implemented
by filtering the archive through the "dd" command with
the "conv" argument.
Directories could be made by forking the "mkdir" utility
instead of handling this internally in bru.
Archived files could be compared against current files
by first extracting the file into a temporary and then
forking the "cmp" or "diff" utility as appropriate.
There are probably other examples as well. I certainly have
mixed feelings about the duplication of functionality and
complications which have been introduced into bru by having
such a relatively large number of built in features. Before
judging me too harshly though, consider the following:
Using another utility such as "dd" to read an
archive negates the bru features of multi-volume
archives, media read/write error recovery, and
utilization of random access read/write.
Forking other utilities releases control over the
format and information content in error reporting.
I am appalled at the number of standard UNIX utilities
which do not use the "perror" routine, or some
equivalent. The message "can't open foo" doesn't tell
me very much.
Utilities which do not fork anything else almost always
run faster.
It is not always clear that forking another utility is
the most "programmer time efficient" way to implement
a feature.
Many of the more complicated uses of bru (such as
periodic backups) will be implemented by invoking
bru via shell scripts anyway. Thus the complicated
features usually only need to be dealt with once by
a single programmer at a given installation.