Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Unix philosophy
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Parts == === ''The UNIX Programming Environment'' === In their preface to the 1984 book, ''[[The UNIX Programming Environment]]'', [[Brian Kernighan]] and [[Rob Pike]], both from [[Bell Labs]], give a brief description of the Unix design and the Unix philosophy:<ref name=unix1984>Kernighan, Brian W. Pike, Rob. ''The UNIX Programming Environment.'' 1984. viii</ref> [[File:Rob-pike-oscon.jpg|thumb|[[Rob Pike]], co-author of ''[[The UNIX Programming Environment]]'']] {{quote|Even though the UNIX system introduces a number of innovative programs and techniques, no single program or idea makes it work well. Instead, what makes it effective is the approach to programming, a philosophy of using the computer. Although that philosophy can't be written down in a single sentence, at its heart is the idea that the power of a system comes more from the relationships among programs than from the programs themselves. Many UNIX programs do quite trivial things in isolation, but, combined with other programs, become general and useful tools.}} The authors further write that their goal for this book is "to communicate the UNIX programming philosophy."{{r|unix1984}} === ''Program Design in the UNIX Environment'' === [[File:Brian Kernighan in 2012 at Bell Labs 2.jpg|thumb|[[Brian Kernighan]] has written at length about the Unix philosophy]] 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]] and [[System V]], and explain the Unix philosophy of software tools, each performing one general function:<ref name="design1984">{{cite journal |title=Program Design in the UNIX Environment |author1=Rob Pike |author2=Brian W. Kernighan |date=October 1984 |url=https://harmful.cat-v.org/cat-v/unix_prog_design.pdf |journal=AT&T Bell Laboratories Technical Journal |volume=63 |issue=8 |at=part 2 |access-date=December 15, 2022}}</ref> {{quote|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 and how they can be used with other programs than on how they are designed internally. [...] This style was based on the use of ''tools'': using programs separately or in combination to get a job done, rather than doing it by hand, by monolithic self-sufficient subsystems, or by special-purpose, one-time programs.}} The authors contrast Unix tools such as {{mono|[[cat (Unix)|cat]]}} with larger program suites used by other systems.<ref name="design1984" /> {{quote|The design of {{mono|cat}} is typical of most UNIX programs: it implements one simple but general function that can be used in many different applications (including many not envisioned by the original author). Other commands are used for other functions. For example, there are separate commands for file system tasks like renaming files, deleting them, or telling how big they are. Other systems instead lump these into a single "file system" command with an internal structure and command language of its own. (The [[Peripheral Interchange Program|PIP]] file copy program<ref>{{cite web |url=http://www.tramm.li/i8080/cpm22-m.pdf |title=CP/M Operating System Manual|date=1983 }}</ref> found on operating systems like [[CP/M]] or [[RSX-11]] is an example.) That approach is not necessarily worse or better, but it is certainly against the UNIX philosophy.}} === Doug McIlroy on Unix programming === [[File:Dennis Ritchie (right) Receiving Japan Prize.jpeg|thumb|[[Doug McIlroy]] (left) with [[Dennis Ritchie]]]] [[Douglas McIlroy|McIlroy]], then head of the Bell Labs Computing Sciences Research Center, and inventor of the [[Pipeline (Unix)|Unix pipe]],<ref>{{citation | author1=[[Dennis Ritchie]] | title=The Evolution of the UNIX Time-Sharing System | journal=[[AT&T Bell Laboratories Technical Journal]] | volume=63 | issue=8 | year=1984 | pages=1577–1593 | url=http://tech-insider.org/unix/research/acrobat/8410.pdf | doi=10.1002/j.1538-7305.1984.tb00054.x}}</ref> summarized the Unix philosophy as follows:<ref name=taoup-ch1s6 /> {{quote|This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle [[standard streams|text streams]], because that is a universal interface.}} Beyond these statements, he has also emphasized simplicity and [[minimalism]] in Unix programming:<ref name=taoup-ch1s6 /> {{quote|The notion of "intricate and beautiful complexities" is almost an oxymoron. Unix programmers vie with each other for "simple and beautiful" honors — a point that's implicit in these rules, but is well worth making overt.}} Conversely, McIlroy has criticized modern [[Linux]] as having [[software bloat]], remarking that, "adoring admirers have fed Linux goodies to a disheartening state of [[obesity]]."<ref>{{cite web|url=http://www.cs.dartmouth.edu/~doug/dmr.pdf|title=Remarks for Japan Prize award ceremony for Dennis Ritchie, May 19, 2011, Murray Hill, NJ|author=Douglas McIlroy|access-date=2014-06-19}}</ref> He contrasts this with the earlier approach taken at Bell Labs when developing and revising [[Research Unix]]:<ref>{{cite web|url=https://archive.org/details/DougMcIlroy_AncestryOfLinux_DLSLUG|title=Ancestry of Linux — How the Fun Began (2005)|author=Bill McGonigle|access-date=2014-06-19}}</ref> {{quote|Everything was small... and my heart sinks for Linux when I see the size of it. [...] The [[man page|manual page]], which really used to be a manual ''page'', is now a small volume, with a thousand options... We used to sit around in the Unix Room saying, 'What can we throw out? Why is there this option?' It's often because there is some deficiency in the basic design — you didn't really hit the right design point. Instead of adding an option, think about what was forcing you to add that option.}} === 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]], invoked this design principle in a criticism of the [[systemd]] architecture, stating that, "attempting to control services, sockets, devices, mounts, etc., all within one [[Daemon (computing)|daemon]] flies in the face of the Unix concept of doing one thing and doing it well."<ref name="volkerding-2012">{{cite web| url=http://www.linuxquestions.org/questions/interviews-28/interview-with-patrick-volkerding-of-slackware-949029/| title=Interview with Patrick Volkerding of Slackware| website=linuxquestions.org | date=2012-06-07| access-date=2015-10-24}}</ref> === Eric Raymond's 17 Unix Rules === In his book ''[[The Art of Unix Programming]]'' that was first published in 2003,<ref>{{cite book |title=The Art of Unix Programming |first=Eric |last=Raymond |author-link=Eric S. Raymond |date=2003-09-19 |isbn=0-13-142901-9 |publisher=Addison-Wesley |url=http://www.catb.org/~esr/writings/taoup/html/ |access-date=2009-02-09 }}</ref> [[Eric S. Raymond]] (open source advocate and programmer) summarizes the Unix philosophy as [[KISS Principle]] of "Keep it Simple, Stupid."<ref>{{cite book |title=The Art of Unix Programming |first=Eric |last=Raymond |author-link=Eric S. Raymond |date=2003-09-19 |isbn=0-13-142901-9 |publisher=Addison-Wesley |url=http://www.catb.org/~esr/writings/taoup/html/ |chapter=The Unix Philosophy in One Lesson |chapter-url=http://www.catb.org/~esr/writings/taoup/html/ch01s07.html |access-date=2009-02-09 }}</ref> He provides a series of design rules:<ref name=taoup-ch1s6 /> * Build [[Modularity (programming)|modular]] programs * Write readable programs * Use composition * [[Separation of mechanism and policy|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 [[Generative programming|abstract programs that generate code]] instead of writing code by hand * [[Software prototyping|Prototype]] software before polishing it * Write flexible and open programs * Make the program and protocols extensible. === Mike Gancarz: The UNIX Philosophy === In 1994, [[Mike Gancarz]], a member of [[Digital Equipment Corporation]]'s Unix Engineering Group (UEG), published ''The UNIX Philosophy'' based on his own Unix ([[Ultrix]]) port development at DEC in the 1980s and discussions with colleagues. He is also a member of the [[X Window System]] development team and author of [[Ultrix Window Manager]] (uwm). The book focuses on porting UNIX to different computers during the [[Unix wars]] 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 file]]s. # Use software leverage to your advantage. # Use [[shell script]]s to increase leverage and portability. # Avoid captive user interfaces. # Make every program a [[Filter (software)#Unix|filter]]. === "Worse is better" === {{Main|Worse is better}} {{unreferenced-section|date=February 2024}} [[Richard P. Gabriel]] 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 [[Input/output|I/O]] in the kernel, the handling of the situation was unclear. The signal handler could not be executed when the process was in kernel mode, with sensitive kernel data on the stack.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)