UNIX/C Program Modularity

Henry Spencer henry at utzoo.UUCP
Thu Oct 31 06:32:48 AEST 1985


> > 	Applications programs that have been designed to run under Unix
> > 	tend to have a low percentage of re-usable code.
> 
> Exactly! What this means is that you get to keep writing NEW stuff! The
> common fragments have mostly been culled out and stuck into a library
> for you. This is the mark of a successful design. 

Actually, "mostly" is overstating the situation.  As various people, notably
the Software Tools folks, have pointed out, it's so easy to do various
things in Unix that nobody gets around to making library routines out of
them -- it's too easy to reinvent the wheel each time.  There ought to be
rather more use of libraries than there is.  Things like getopt(3) and the
SysV string(3) routines are forward steps.  (Note to listeners:  both of
these examples exist in public-domain versions that have been posted to
the net repeatedly, so there is NO EXCUSE for not having them.)  Some of
the functions in Kernighan&Pike are also good candidates for putting in
libraries.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list