Modularization
brnstnd at stealth.acf.nyu.edu
brnstnd at stealth.acf.nyu.edu
Mon Jan 8 09:25:50 AEST 1990
In article <1990Jan6.233340.9978 at smsc.sony.com> dce at Sony.COM (David Elliott) writes:
> Some people I have
> worked with like to put awk scripts in separate files. To me, that's
> like breaking up your C program into separate binaries and exec'ing
> them as needed - it slows down the program and makes it harder to
> maintain.
Modularization makes programs easier to maintain if it represents a
clean break between separate functions.
I use just one program, pty, as the sole interface between other
programs and pseudo-terminals. Of course it requires an extra exec,
but my programs and shell scripts are much more portable. A different
system might implement pseudo-terminals as streams; the only program
that needs to change is pty. This makes the programs easier, not harder,
to maintain.
Similar comments apply to my tcp and attachport programs, which handle
everything that a typical Internet application needs. Most of my network
programs now don't know anything about TCP; they just talk to a few file
descriptors. This not only makes the programs easier to maintain, but
also makes it trivial to use the same protocol with several different
communications mechanisms. Actually, it's not fully modular yet, because
tcp and attachport don't understand OOB signals, but the principle is
valid.
---Dan
More information about the Comp.unix.wizards
mailing list