
The Unix philosophy, originated by
Ken Thompson, is a set of cultural norms and philosophical approaches to
minimalist,
modular
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
software development
Software development is the process of conceiving, specifying, designing, programming, documenting, testing, and bug fixing involved in creating and maintaining applications, frameworks, or other software components. Software development invol ...
. It is based on the experience of leading developers of the
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
. Early Unix developers were important in bringing the concepts of modularity and reusability into software engineering practice, spawning a "
software tools
A programming tool or software development tool is a computer program that software developers use to create, debug, maintain, or otherwise support other programs and applications. The term usually refers to relatively simple programs, that can ...
" movement. Over time, the leading developers of Unix (and programs that ran on it) established a set of cultural norms for developing software; these norms became as important and influential as the technology of Unix itself, and have been termed the "Unix philosophy."
The Unix philosophy emphasizes building simple, compact, clear, modular, and
extensible
Extensibility is a software engineering and systems design principle that provides for future growth. Extensibility is a measure of the ability to extend a system and the level of effort required to implement the extension. Extensions can be th ...
code that can be easily maintained and repurposed by developers other than its creators. The Unix philosophy favors
composability
Composability is a system design principle that deals with the inter-relationships of components. A highly composable system provides components that can be selected and assembled in various combinations to satisfy specific user requirements. In ...
as opposed to
monolithic design.
Origin
The Unix philosophy is documented by
Doug McIlroy
Malcolm Douglas McIlroy (born 1932) is a mathematician, engineer, and programmer. As of 2019 he is an Adjunct Professor of Computer Science at Dartmouth College.
McIlroy is best known for having originally proposed Unix pipelines and developed se ...
in the Bell System Technical Journal from 1978:
# Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features".
# Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.
# Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them.
# Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.
It was later summarized by
Peter H. Salus
Peter Henry Salus is a linguist, computer scientist, historian of technology, author in many fields, and an editor of books and journals. He has conducted research in germanistics, language acquisition, and computer languages.
Education and c ...
in A Quarter-Century of Unix (1994):
* Write programs that do one thing and do it well.
* Write programs to work together.
* Write programs to handle text streams, because that is a universal interface.
In their award-winning Unix paper of 1974, Ritchie and Thompson quote the following design considerations:
* Make it easy to write, test, and run programs.
* Interactive use instead of
batch processing
Computerized batch processing is a method of running software programs called jobs in batches automatically. While users are required to submit the jobs, no other interaction by the user is required to process the batch. Batches may automatically ...
.
*
Economy
An economy is an area of the production, distribution and trade, as well as consumption of goods and services. In general, it is defined as a social domain that emphasize the practices, discourses, and material expressions associated with the ...
and
elegance of design due to size constraints ("salvation through suffering").
*
Self-supporting system: all Unix software is maintained under Unix.
''The UNIX Programming Environment''
In their preface to the 1984 book, ''
The UNIX Programming Environment'',
Brian Kernighan and
Rob Pike, both from
Bell Labs
Nokia Bell Labs, originally named Bell Telephone Laboratories (1925–1984),
then AT&T Bell Laboratories (1984–1996)
and Bell Labs Innovations (1996–2007),
is an American industrial research and scientific development company owned by mult ...
, give a brief description of the Unix design and the Unix philosophy:
[Kernighan, Brian W. Pike, Rob. ''The UNIX Programming Environment.'' 1984. viii]

The authors further write that their goal for this book is "to communicate the UNIX programming philosophy."
''Program Design in the UNIX Environment''

In October 1984, Brian Kernighan and Rob Pike published a paper called ''Program Design in the UNIX Environment''. In this paper, they criticize the accretion of program options and features found in some newer Unix systems such as
4.2BSD The History of the Berkeley Software Distribution begins in the 1970s.
1BSD (PDP-11)
The earliest distributions of Unix from Bell Labs in the 1970s included the source code to the operating system, allowing researchers at universities to modify a ...
and
System V, and explain the Unix philosophy of software tools, each performing one general function:
The authors contrast Unix tools such as with larger program suites used by other systems.
Doug McIlroy on Unix programming
McIlroy, then head of the Bell Labs Computing Sciences Research Center, and inventor of the
Unix pipe
In Unix-like computer operating systems, a pipeline is a mechanism for inter-process communication using message passing. A pipeline is a set of processes chained together by their standard streams, so that the output text of each process (''stdou ...
, summarized the Unix philosophy as follows:
Beyond these statements, he has also emphasized simplicity and
minimalism
In visual arts, music and other media, minimalism is an art movement that began in post–World War II in Western art, most strongly with American visual arts in the 1960s and early 1970s. Prominent artists associated with minimalism include Don ...
in Unix programming:
Conversely, McIlroy has criticized modern
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
as having
software bloat
Software bloat is a process whereby successive versions of a computer program become perceptibly slower, use more memory, disk space or processing power, or have higher hardware requirements than the previous version, while making only dubious use ...
, remarking that, "adoring admirers have fed Linux goodies to a disheartening state of
obesity
Obesity is a medical condition, sometimes considered a disease, in which excess body fat has accumulated to such an extent that it may negatively affect health. People are classified as obese when their body mass index (BMI)—a person's we ...
." He contrasts this with the earlier approach taken at Bell Labs when developing and revising
Research Unix:
Do One Thing and Do It Well
As stated by McIlroy, and generally accepted throughout the Unix community, Unix programs have always been expected to follow the concept of DOTADIW, or "Do One Thing And Do It Well." There are limited sources for the acronym DOTADIW on the Internet, but it is discussed at length during the development and packaging of new operating systems, especially in the Linux community.
Patrick Volkerding, the project lead of
Slackware Linux
Slackware is a Linux distribution created by Patrick Volkerding in 1993. Originally based on Softlanding Linux System, Slackware has been the basis for many other Linux distributions, most notably the first versions of SUSE Linux distributions ...
, invoked this design principle in a criticism of the
systemd
systemd is a software suite that provides an array of system components for Linux operating systems. Its main aim is to unify service configuration and behavior across Linux distributions; Its primary component is a "system and service manager ...
architecture, stating that, "attempting to control services, sockets, devices, mounts, etc., all within one
daemon flies in the face of the Unix concept of doing one thing and doing it well."
Eric Raymond's 17 Unix Rules
In his book ''
The Art of Unix Programming'' that was first published in 2003,
Eric S. Raymond
Eric Steven Raymond (born December 4, 1957), often referred to as ESR, is an American software developer, open-source software advocate, and author of the 1997 essay and 1999 book ''The Cathedral and the Bazaar''. He wrote a guidebook for the ...
(open source advocate and programmer) summarizes the Unix philosophy as
KISS Principle of "Keep it Simple, Stupid." He provides a series of design rules:
* Build
modular
Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a sy ...
programs
* Write readable programs
* Use composition
*
Separate mechanisms from policy
* Write simple programs
* Write small programs
* Write transparent programs
* Write robust programs
* Make data complicated when required, not the program
* Build on potential users' expected knowledge
* Avoid unnecessary output
* Write programs which fail in a way that is easy to diagnose
* Value developer time over machine time
* Write
abstract programs that generate code instead of writing code by hand
*
Prototype
A prototype is an early sample, model, or release of a product built to test a concept or process. It is a term used in a variety of contexts, including semantics, design, electronics, and Software prototyping, software programming. A prototyp ...
software before polishing it
* Write flexible and open programs
* Make the program and protocols extensible.
Mike Gancarz: The UNIX Philosophy
In 1994,
Mike Gancarz
Mike may refer to:
Animals
* Mike (cat), cat and guardian of the British Museum
* Mike the Headless Chicken, chicken that lived for 18 months after his head had been cut off
* Mike (chimpanzee), a chimpanzee featured in several books and documen ...
, a member of
Digital Equipment Corporation
Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president unt ...
's Unix Engineering Group (UEG), published ''The UNIX Philosophy'' based on his own Unix (
Ultrix
Ultrix (officially all-caps ULTRIX) is the brand name of Digital Equipment Corporation's (DEC) discontinued native Unix operating systems for the PDP-11, VAX, MicroVAX and DECstations.
History
The initial development of Unix occurred on DEC equip ...
) port development at DEC in the 1980s and discussions with colleagues. He is also a member of the
X Window System
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
X provides the basic framework for a GUI environment: drawing and moving windows on the display device and interacting wit ...
development team and author of
Ultrix Window Manager (uwm).
The book focuses on porting UNIX to different computers during the
UNIX wars
The Unix wars were struggles between vendors to set a standard for the Unix operating system in the late 1980s and early 1990s.
Origins
Although AT&T Corporation created Unix, by the 1980s, the University of California, Berkeley Computer Syste ...
of the 1980s and describes his philosophy that portability should be more important than the efficiency of using non-standard interfaces for hardware and graphics devices.
The nine basic "tenets" he claims to be important are
# Small is beautiful.
# Make each program do one thing well.
# Build a prototype as soon as possible.
# Choose portability over efficiency.
# Store data in flat
text files.
# Use software leverage to your advantage.
# Use
shell script
A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manip ...
s to increase leverage and portability.
# Avoid captive user interfaces.
# Make every program a
filter.
"Worse is better"
Richard P. Gabriel
Richard P. Gabriel (born 1949) is an American computer scientist known for his work in computing related to the programming language Lisp, and especially Common Lisp. His best known work was a 1990 essay "Lisp: Good News, Bad News, How to Win Bi ...
suggests that a key advantage of Unix was that it embodied a design philosophy he termed "worse is better", in which simplicity of both the interface ''and'' the implementation are more important than any other attributes of the system—including correctness, consistency, and completeness. Gabriel argues that this design style has key evolutionary advantages, though he questions the quality of some results.
For example, in the early days Unix used a
monolithic kernel (which means that user processes carried out kernel system calls all on the user stack). If a signal was delivered to a process while it was blocked on a long-term
I/O in the kernel, then what should be done? Should the signal be delayed, possibly for a long time (maybe indefinitely) while the I/O completed? The signal handler could not be executed when the process was in kernel mode, with sensitive kernel data on the stack. Should the kernel back-out the system call, and store it, for replay and restart later, assuming that the signal handler completes successfully?
In these cases
Ken Thompson and
Dennis Ritchie
Dennis MacAlistair Ritchie (September 9, 1941 – October 12, 2011) was an American computer scientist. He is most well-known for creating the C programming language and, with long-time colleague Ken Thompson, the Unix operating system and B p ...
favored simplicity over perfection. The Unix system would occasionally return early from a system call with an error stating that it had done nothing—the "Interrupted System Call", or an error number 4 (
EINTR
) in today's systems. Of course the call had been aborted in order to call the signal handler. This could only happen for a handful of long-running system calls such as
read()
,
write()
,
open()
, and
select()
. On the plus side, this made the I/O system many times simpler to design and understand. The vast majority of user programs were never affected because they did not handle or experience signals other than
SIGINT
and would die right away if one was raised. For the few other programs—things like shells or text editors that respond to job control key presses—small wrappers could be added to system calls so as to retry the call right away if this
EINTR
error was raised. Thus, the problem was solved in a simple manner.
Criticism
In a 1981 article entitled "The truth about Unix: ''The user interface is horrid''"
published in ''
Datamation
''Datamation'' is a computer magazine that was published in print form in the United States between 1957 and 1998, '',
Don Norman
Donald Arthur Norman (born December 25, 1935) is an American researcher, professor, and author. Norman is the director of The Design Lab at University of California, San Diego. He is best known for his books on design, especially ''The Design ...
criticized the design philosophy of Unix for its lack of concern for the user interface. Writing from his background in cognitive science and from the perspective of the then-current philosophy of
cognitive engineering
Cognitive engineering is a method of study using cognitive psychology to design and develop engineering systems to support the cognitive processes of users.
History
It was an engineering method used in the 1970s at Bell Labs, focused on how peopl ...
,
he focused on how end-users comprehend and form a personal
cognitive model of systems—or, in the case of Unix, fail to understand, with the result that disastrous mistakes (such as losing an hour's worth of work) are all too easy.
See also
*
Cognitive engineering
Cognitive engineering is a method of study using cognitive psychology to design and develop engineering systems to support the cognitive processes of users.
History
It was an engineering method used in the 1970s at Bell Labs, focused on how peopl ...
*
Unix architecture
A Unix architecture is a computer operating system system architecture that embodies the Unix philosophy. It may adhere to standards such as the Single UNIX Specification (SUS) or similar POSIX IEEE standard. No single published standard descri ...
*
Minimalism (computing)
*
Software engineering
Software engineering is a systematic engineering approach to software development.
A software engineer is a person who applies the principles of software engineering to design, develop, maintain, test, and evaluate computer software. The term '' ...
*
KISS principle
*
Hacker ethic
*
List of software development philosophies
*
Everything is a file
Everything is a file is an idea that Unix, and its derivatives handle input/output to and from resources such as documents, hard-drives, modems, keyboards, printers and even some inter-process and network communications as simple streams of byte ...
*
Worse is better
Worse is better (also called the New Jersey style) is a term conceived by Richard P. Gabriel in an essay of the same name to describe the dynamics of software acceptance. It refers to the argument that software quality does not necessarily increas ...
Notes
References
*
The Unix Programming Environment' by
Brian Kernighan and
Rob Pike, 1984
*
Program Design in the UNIX Environment' – The paper by Pike and Kernighan that preceded the book.
''Notes on Programming in C'' Rob Pike, September 21, 1989
* ''A Quarter Century of Unix'', Peter H. Salus, Addison-Wesley, May 31, 1994 ()
nbsp;— fro
''The Art of Unix Programming'' Eric S. Raymond, Addison-Wesley, September 17, 2003 ()
by M. D. Schroeder, D. D. Clark, J. H. Saltzer, and D. H. Wells, 1977.
* ''The UNIX Philosophy'', Mike Gancarz,
External links
– by Catb.org
– by The Linux Information Project (LINFO)
Why the Unix Philosophy still matters
{{Unix
Software development philosophies
Unix