meillo@24: .TL meillo@24: \fR\s-6Why\s0\fP meillo@24: .br meillo@24: the Unix Philosophy meillo@24: .br meillo@24: .vs -4 meillo@24: \fR\s-6(still) matters\s0\fP meillo@24: .AU meillo@24: .ft R meillo@24: .sp 1.2i meillo@24: .ps 11 meillo@24: markus schnalke meillo@24: meillo@24: meillo@24: .S "goals of this talk meillo@24: .I meillo@24: introduce the Unix Phil meillo@24: .I meillo@24: explain why most modern software is crap meillo@24: .I meillo@24: explain why the Unix Phil leads to better software meillo@24: .I meillo@24: convince you that good software is of matter meillo@24: .sp 2 meillo@24: .I meillo@24: make you think meillo@24: meillo@24: meillo@24: .S "roadmap meillo@24: .I meillo@24: Historical background meillo@24: .I meillo@24: What is the Unix Philosophy? meillo@24: .I meillo@24: The Unix Phil after Gancarz meillo@24: .I meillo@24: Discussion on real world examples meillo@24: .I meillo@24: The Unix Phil is more than software dev guidelines meillo@24: meillo@24: meillo@24: meillo@24: .S "me and the UP meillo@24: .LP meillo@24: first contact: through the suckless project meillo@24: .LP meillo@24: ``cat -v Considered Harmful'' meillo@24: .LP meillo@24: ``The Unix and the Echo'' meillo@24: .LP meillo@24: ``The Unix Programming Environment'' meillo@24: .sp 1 meillo@24: .LP meillo@24: better understanding through digging in the past meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: .P "historical background meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: .S "historical background meillo@24: .I meillo@24: the late 60s and early 70s meillo@24: .I meillo@24: operating systems are complex meillo@24: .I meillo@24: MULTICS just failed meillo@24: .I meillo@24: Brooks' ``The Mythical Man-Month'' meillo@24: .I meillo@24: a lot of different hardware meillo@24: .I meillo@24: limited computing power meillo@24: .I meillo@24: textual input and output (line printers) meillo@24: meillo@24: meillo@24: .S "everything is a file meillo@24: .LP meillo@24: is the(?) basic concept in Unix (and even more in Plan9) meillo@24: .LP meillo@24: made simple operating systems possible meillo@24: .LP meillo@24: it is not covered by the Unix Phil; the Unix Phil is on a different level meillo@24: .sp 2 meillo@24: .LP meillo@24: Unix is mainly two things: meillo@24: .I meillo@24: an operating system (system calls) meillo@24: .I meillo@24: a toolchest (coreutils) meillo@24: meillo@24: meillo@24: meillo@24: .P "What is the Unix Phil meillo@24: meillo@24: meillo@24: meillo@24: .S "What is the Unix Phil *itself*? meillo@24: .LP meillo@24: ``The Unix philosophy is a set of cultural norms and philosophical meillo@24: approaches to developing software based on the experience of meillo@24: leading developers of the Unix operating system.'' meillo@24: (wikipedia) meillo@24: .sp 2 meillo@24: .LP meillo@24: How the inventors of Unix write software. meillo@24: .LP meillo@24: Common things of classic Unix tools. meillo@24: .sp 2 meillo@24: .LP meillo@24: difficult to define meillo@24: meillo@24: meillo@24: .S "Unix Phil vs. SW dev processes meillo@24: .LP meillo@24: the Unix Phil meillo@24: .I meillo@24: much: *what* to program meillo@24: .I meillo@24: few: *how* to program meillo@24: meillo@24: .LP meillo@24: Software developments processes: meillo@24: .I meillo@24: few: *what* to program meillo@24: .I meillo@24: much: *how* to program meillo@24: meillo@24: .sp 2 meillo@24: .LP meillo@24: Extreme Programming is like the Unix Phil meillo@24: but with more *how* than *what*, meillo@24: and with formalisms meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: .S "What is the Unix Phil? meillo@24: .I meillo@24: Doug McIlroy (1978) meillo@24: .I meillo@24: Mike Gancarz: ``The Unix Philosophy'' (1994) meillo@24: .I meillo@24: Eric S. Raymond: ``The Art of Unix Programming'' (2003) meillo@24: .sp 2 meillo@24: .I meillo@24: Richard Gabriel: ``Worse is Better'' (1989) meillo@24: meillo@24: meillo@24: .S "Doug McIlroy meillo@24: .LP meillo@24: This is the Unix philosophy: meillo@24: .I meillo@24: Write programs that do one thing and do it well. meillo@24: .I meillo@24: Write programs to work together. meillo@24: .I meillo@24: Write programs to handle text streams, because that is a universal interface. meillo@24: meillo@24: meillo@24: .S "Mike Gancarz: ``The Unix Philosophy'' meillo@24: .I meillo@24: Small is beautiful. meillo@24: .I meillo@24: Make each program do one thing well. meillo@24: .I meillo@24: Build a prototype as soon as possible. meillo@24: .I meillo@24: Choose portability over efficiency. meillo@24: .I meillo@24: Store data in flat text files. meillo@24: .I meillo@24: Use software leverage to your advantage. meillo@24: .I meillo@24: Use shell scripts to increase leverage and portability. meillo@24: .I meillo@24: Avoid captive user interfaces. meillo@24: .I meillo@24: Make every program a filter. meillo@24: .sp 1 meillo@24: .LP meillo@24: plus ten lesser tenets meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: .P "The Unix Phil after Gancarz meillo@24: meillo@25: meillo@25: meillo@25: .S "Small is beautiful meillo@25: .I meillo@25: small software is easier to understand, write, maintain meillo@25: .I meillo@25: less lines of code contain less bugs meillo@25: .I meillo@25: monsters are large meillo@25: meillo@25: meillo@25: .S "Make each program do one thing well meillo@25: .I meillo@25: programs with many functions are large meillo@25: .I meillo@25: one thing is easier to understand meillo@25: .I meillo@25: often straight forward to implement meillo@25: .I meillo@25: reusable meillo@25: meillo@25: meillo@25: .S "Build a prototype as soon as possible meillo@25: .I meillo@25: shows the quality of the design meillo@25: .I meillo@25: shows the problems of the software meillo@25: .I meillo@25: the best way to shape a software meillo@25: .I meillo@25: users find bugs meillo@25: meillo@25: meillo@25: .S "Choose portability over efficiency meillo@25: .I meillo@25: (comes from incompatible hardware in history) meillo@25: .I meillo@25: use is most important meillo@25: .I meillo@25: availability meillo@25: .I meillo@25: only needs to be fast enough meillo@25: meillo@25: meillo@25: .S "Store data in flat text files meillo@24: .LP meillo@25: binary data is machine dependent meillo@25: .LP meillo@25: human readable data is: meillo@25: .I meillo@25: is very likely supported meillo@25: .I meillo@25: good to port meillo@25: .I meillo@25: many tools work on it (Unix toolchest) meillo@25: .I meillo@25: as generic as possible meillo@25: .LP meillo@25: processing needs only to be fast enough meillo@24: meillo@24: meillo@25: .S "Use software leverage to your advantage meillo@24: .LP meillo@25: what do we have computers for? meillo@25: .LP meillo@25: make best use of computing power meillo@25: .LP meillo@25: reduce development effort meillo@24: meillo@24: meillo@25: .S "Use shell scripts to increase leverage and portability meillo@24: .LP meillo@25: was very important in history meillo@25: .LP meillo@25: high level languages meillo@25: .LP meillo@25: prototyping meillo@25: .LP meillo@25: quick hacks meillo@24: meillo@24: meillo@25: .S "Avoid captive user interfaces meillo@24: .LP meillo@25: don't assume the user to be human meillo@25: .LP meillo@25: exclude the user whenever possible meillo@25: .LP meillo@25: automate meillo@24: meillo@24: meillo@25: .S "Make every program a filter meillo@24: .LP meillo@25: programs transform data meillo@25: .LP meillo@25: combine programs meillo@25: .LP meillo@25: have one common interface meillo@24: meillo@24: meillo@24: meillo@25: .S "a different POV meillo@25: .I meillo@25: pipes meillo@25: .I meillo@25: interface design meillo@25: .I meillo@25: the toolchest approach meillo@25: .I meillo@25: a powerful shell meillo@25: .I meillo@25: worse is better meillo@25: .I meillo@25: upgrowth and survival meillo@24: meillo@24: meillo@24: meillo@24: .P "real world examples meillo@24: meillo@24: meillo@24: .S "various meillo@24: .LP meillo@24: who uses meillo@24: .CW "grep -R meillo@24: ? meillo@24: meillo@24: .sp 1 meillo@24: .LP meillo@24: .CW "cat -v meillo@24: meillo@24: .sp 1 meillo@24: .LP meillo@24: pagers are taken for granted meillo@24: meillo@24: .sp 1 meillo@24: .LP meillo@24: what about the readline? meillo@24: meillo@24: meillo@24: meillo@24: .S "find -printf meillo@24: .LP meillo@24: How to reformat the output of find(1) to have ``FILENAME PATH'' meillo@24: instead of ``PATH/FILENAME''? meillo@24: meillo@24: .LP meillo@24: the ``easy'' way: meillo@24: \f(CWfind /dir -printf "%P %h\en"\fP meillo@24: meillo@24: .LP meillo@24: the ``good'' way: meillo@24: .br meillo@24: .CW "\s-1find /dir | sed 's,\e(.*\e)/\e(.*\e),\e2 \e1,' meillo@24: meillo@24: .LP meillo@24: The difference shows off when one wants, for instance, meillo@24: the path to be manipulated further. meillo@24: meillo@24: meillo@24: .S "MH / nmh meillo@24: .LP meillo@24: a Mail User Agent (MUA) meillo@25: .LP meillo@25: is a toolchest meillo@25: .LP meillo@25: work with mails like with generic files meillo@25: .LP meillo@25: the only(?) MUA that follows the Unix Phil meillo@25: .LP meillo@25: has a very special feeling meillo@24: meillo@24: meillo@24: .S "uzbl meillo@24: .LP meillo@24: a web browser that adheres to the Unix Phil meillo@25: .LP meillo@25: a young project (about 1 year) meillo@25: .LP meillo@25: central question: what is the one task a web browser covers? meillo@25: .LP meillo@25: makes very visible use of software leverage meillo@25: .LP meillo@25: suffers hard from our broken web meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: .P "more than software dev guidelines meillo@24: meillo@24: meillo@25: .S "say no meillo@25: .LP meillo@25: in today's computer world, the Unix Phil is much of asceticism meillo@25: .LP meillo@25: one needs to abjure a lot of ``nice'' features meillo@25: .LP meillo@25: IMO that leads to a valuable attitude meillo@25: meillo@25: meillo@25: .S "avoid complexity meillo@25: .LP meillo@25: avoid complexity first and foremost meillo@25: .LP meillo@25: complexity is the ``boss enemy'' software developers fight against meillo@25: .LP meillo@25: strive for simplicity, clarity, generality meillo@25: meillo@25: meillo@25: .S "good solutions meillo@25: .LP meillo@25: we don't need just solutions, we need good ones meillo@25: .LP meillo@25: today, we can make things possible, meillo@25: but we still cannot make them good meillo@25: meillo@25: meillo@25: .S "live it meillo@25: .LP meillo@25: the Unix Phil is not just a few guidelines meillo@25: .LP meillo@25: you cannot follow just some of the tenets meillo@25: .LP meillo@25: you will not understand the Unix Phil when you don't engage with it meillo@25: .sp 3 meillo@25: .LP meillo@25: .ce meillo@25: it's a philosophy \(en live it! meillo@24: meillo@24: meillo@24: meillo@24: .P "literature meillo@24: meillo@24: meillo@24: .S literature meillo@24: .I meillo@24: ``\fBText Processing and Typesetting with Unix\fP'' meillo@24: by Barron and Rees meillo@24: explains everything pretty good (focus on meillo@24: .CW nroff ) meillo@24: .I meillo@24: ``\fBHeirloom Documentation Tools Nroff/Troff User's Manual\fP'' meillo@24: by Ossanna, Kernighan, and Ritter meillo@24: is more a technical reference meillo@24: .I meillo@24: Various documents collected on meillo@24: .CW \s-2http://troff.org\s+2 meillo@24: meillo@24: meillo@24: .S meillo@24: .LP meillo@24: this talk was prepared using tools of the Heirloom project: meillo@24: .CW \s-2http://heirloom.sf.net\s+2 meillo@24: .LP meillo@24: the slides macros are based on meillo@24: .br meillo@24: .CW \s-2http://repo.cat-v.org/troff-slider/\s+2 meillo@24: .sp meillo@24: meillo@24: .LP meillo@24: the slides are available on my website meillo@24: .CW \s-2http://marmaro.de/docs\s+2 meillo@24: and on meillo@24: .CW \s-2http://ulm.ccc.de/ChaosSeminar/\s+2 meillo@24: .sp meillo@24: meillo@24: 2010-03-08