Program design in the UNIX† environment (2007)

Much of the power of the UNIX operating system comes from a style of program design that makes programs easy to use and, more important, easy to combine with other programs. This style has been called the use of software tools, and depends more on how the programs fit into the programming environment how they can be used with other programs than on how they are designed internally. But as the system has become commercially successful and has spread widely, this style has often been compromised, to the detriment of all users. Old programs have become encrusted with dubious features. Newer programs are not always written with attention to proper separation of function and design for interconnection. This paper discusses the elements of program design, showing by example good and bad design, and indicates some possible trends for the future. The UNIX operating system has become a great commercial success, and is likely to be the standard operating system for microcomputers and some mainframes in the coming years. There are good reasons for this popularity. One is portability: the operating system kernel and the applications programs are written in the programming language C, and thus can be moved from one type of computer to another with much less effort than would be involved in recreating them in the assembly language of each machine. Essentially the same operating system therefore runs on a wide variety of computers, and users needn’t learn a new system when new hardware comes along. Perhaps more important, vendors that sell the UNIX system needn’t provide new software for each new machine; instead, their software can be compiled and run without change on any hardware, which makes the system commercially attractive. There is also an element of zealotry: users of the system tend to be enthusiastic and to expect it wherever they go; the students who used the UNIX system in university a few years ago are now in the job market and often demand it as a condition of employment. But the UNIX system was popular long before it was even portable, let alone a commercial success. The reasons for that are more interesting. Except for the initial PDP-7 version, the UNIX system was written for the DEC PDP-11, a machine that was (deservedly) very popular. PDP-11’s were powerful enough to do real computing, but small enough to be affordable by small organizations such as academic departments in universities. The early UNIX system was smaller but more effective and technically more interesting than competing systems on the same hardware. It provided a number of innovative applications of computer science, showing the benefits to be obtained by a judicious blend of theory and practice. Examples include the yacc parser-generator, the diff file comparison program, and the pervasive use of regular expressions to describe string patterns. These led in turn to new programming languages and interesting software for applications like program development, document preparation and circuit design. Since the system was modest in size, and since essentially everything was written in C, the software was easy to modify, to customize for particular applications or merely to support a view of the world __________________ UNIX is a trademark of Bell Laboratories.