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@24: .S "Small is beautiful. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Make each program do one thing well. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Build a prototype as soon as possible. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Choose portability over efficiency. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Store data in flat text files. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Use software leverage to your advantage. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Use shell scripts to increase leverage and portability. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Avoid captive user interfaces. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: meillo@24: .S "Make every program a filter. meillo@24: .LP meillo@24: foo meillo@24: meillo@24: 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@24: meillo@24: meillo@24: .S "uzbl meillo@24: .LP meillo@24: a web browser that adheres to the Unix Phil meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: .P "more than software dev guidelines meillo@24: meillo@24: 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