- 论坛徽章:
- 0
|
calls sufficient for most applications programming (filesystem operations, signals, and
process control) in their heads, the C library on modern Unixes includes many hundreds of
entry points for, e.g. mathematical functions, that won't all fit inside a single programmer's
cranium.
Among Unix tools, make(1) is compact; autoconf(1) and automake(1) are not. Among
markup languages, HTML is compact, but DocBook (a documentation markup language we
shall discuss in Chapter 16 (Documentation)) is not. Man-page macros are compact, but
troff(1) markup is not.
Among general-purpose programming languages, C and Python are compact; C++, Perl,
Java, Emacs Lisp, and shell are not (especially since serious shell programming requires you
to know half-a dozen other tools like sed(1) and awk(1)).
Some designs that are not compact have enough internal redundancy of features that
individual programmers end up carving out compact dialects sufficient for that 85% of
common tasks by choosing a working subset of the language. Perl is like this, for example.
Such designs have a built-in trap; when two programmers try to communicate about a
project, they may find that differences in their working subsets are a significant barrier to
understanding and modifying the code.
Non-compact designs are not automatically doomed or bad, however. Some problem
domains are simply too complex for a compact design to span them. Sometimes it's
necessary to trade away compactness for some other virtue, like raw power and range. Troff
markup is a good example of this. So is the BSD sockets API. The purpose of emphasizing
compactness as a virtue is not to teach the reader to treat compactness as an absolute
requirement, but to do what Unix programmers do 鈥 |
|