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@26: \fR\s-6still 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@27: .S "Goals of this talk meillo@24: .I meillo@27: Introduce the Unix Phil meillo@24: .I meillo@27: Show that most modern software is crap meillo@24: .I meillo@28: Explain why the Unix Phil leads to good/better software meillo@24: .I meillo@27: Convince you that good software is of matter meillo@24: .sp 2 meillo@24: .I meillo@27: Make you think meillo@24: meillo@24: meillo@27: .S "Roadmap meillo@24: .I meillo@28: Background meillo@24: .I meillo@27: What is the Unix Phil? meillo@24: .I meillo@24: The Unix Phil after Gancarz meillo@24: .I meillo@28: Real world examples meillo@24: .I meillo@28: Final thoughts meillo@24: meillo@24: meillo@24: meillo@28: meillo@28: .P "Background meillo@28: meillo@28: meillo@28: meillo@28: .S "How I met the Unix Phil meillo@24: .LP meillo@27: First contact through dwm (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@28: .LP meillo@24: .sp 1 meillo@27: Better understanding through digging in the past meillo@24: meillo@24: meillo@27: .S "Historical background meillo@27: .LP meillo@27: The late 60s and early 70s meillo@27: .LP meillo@27: Operating systems are complex meillo@27: .LP meillo@24: Brooks' ``The Mythical Man-Month'' meillo@27: .LP meillo@27: MULTICS had just failed meillo@27: .LP meillo@27: A lot of different hardware meillo@27: .LP meillo@27: Limited computing power meillo@27: .LP meillo@27: Textual input and output (line printers) meillo@24: meillo@24: meillo@27: .S "Everything is a file meillo@24: .LP meillo@27: Is the(?) basic concept in Unix (and even more in Plan9) meillo@24: .LP meillo@27: Made simple operating systems possible meillo@24: .LP meillo@27: It is not covered by the Unix Phil meillo@27: .br meillo@27: The Unix Phil is on a different level meillo@28: .LP meillo@24: .sp 2 meillo@24: Unix is mainly two things: meillo@24: .I meillo@27: An operating system (system calls) meillo@24: .I meillo@27: A toolchest (coreutils) meillo@24: meillo@24: meillo@24: meillo@27: .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@27: Difficult to define meillo@24: meillo@24: meillo@24: .S "Unix Phil vs. SW dev processes meillo@24: .LP meillo@27: 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@27: 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@27: .LP meillo@27: Small software is easier to understand, write, maintain meillo@27: .LP meillo@27: Less lines of code contain less bugs meillo@27: .LP meillo@27: Monsters are large meillo@25: meillo@25: meillo@25: .S "Make each program do one thing well meillo@27: .LP meillo@27: Programs with many functions are large meillo@27: .LP meillo@27: One thing is easier to understand meillo@27: .LP meillo@27: Often straight forward to implement meillo@27: .LP meillo@28: Toolchests meillo@28: .LP meillo@27: Reusable meillo@25: meillo@25: meillo@25: .S "Build a prototype as soon as possible meillo@27: .LP meillo@27: Shows the quality of the design meillo@27: .LP meillo@27: Shows the problems of the software meillo@27: .LP meillo@27: The best way to shape a software meillo@27: .LP meillo@27: Users find bugs meillo@28: .LP meillo@28: Incremental development meillo@25: meillo@25: meillo@25: .S "Choose portability over efficiency meillo@27: .LP meillo@27: (Originates in a lot of incompatible hardware in history) meillo@27: .LP meillo@27: Use is most important meillo@27: .LP meillo@27: Availability meillo@27: .LP meillo@27: Only needs to be fast enough meillo@25: meillo@25: meillo@25: .S "Store data in flat text files meillo@24: .LP meillo@28: (originally: ``Store numerical data in flat ASCII files'') meillo@28: .LP meillo@27: Binary data is machine-dependent meillo@25: .LP meillo@27: Human readable data is: meillo@25: .I meillo@27: As generic as possible meillo@25: .I meillo@27: Is very likely supported meillo@25: .I meillo@27: Many tools work on it (Unix toolchest) meillo@25: .I meillo@27: Directly editable by humans meillo@25: .LP meillo@27: Processing needs only to be fast enough meillo@24: meillo@24: meillo@25: .S "Use software leverage to your advantage meillo@24: .LP meillo@27: What do we have computers for? meillo@25: .LP meillo@27: Make best use of computing power meillo@25: .LP meillo@27: Reduce development effort meillo@28: .LP meillo@28: Toolchests and a powerful shell meillo@24: meillo@24: meillo@25: .S "Use shell scripts to increase leverage and portability meillo@24: .LP meillo@27: Was very important in history meillo@25: .LP meillo@27: High level languages meillo@25: .LP meillo@27: Prototyping meillo@25: .LP meillo@27: Quick hacks meillo@28: .LP meillo@28: Users are ``programmers'' meillo@24: meillo@24: meillo@25: .S "Avoid captive user interfaces meillo@24: .LP meillo@27: Don't assume the user to be human meillo@25: .LP meillo@27: Exclude the user whenever possible meillo@25: .LP meillo@27: Automate meillo@28: .LP meillo@28: How does it scale? meillo@28: .LP meillo@28: Bloat meillo@24: meillo@24: meillo@25: .S "Make every program a filter meillo@24: .LP meillo@27: Programs transform data meillo@25: .LP meillo@27: Combine programs meillo@25: .LP meillo@27: Have one common interface meillo@28: .LP meillo@28: Toolchests meillo@24: meillo@24: meillo@24: meillo@24: .P "real world examples 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: .LP meillo@27: The ``easy'' way: meillo@24: \f(CWfind /dir -printf "%P %h\en"\fP meillo@24: .LP meillo@27: The ``good'' way: meillo@24: .br meillo@24: .CW "\s-1find /dir | sed 's,\e(.*\e)/\e(.*\e),\e2 \e1,' meillo@24: .LP meillo@24: The difference shows off when one wants, for instance, meillo@24: the path to be manipulated further. meillo@28: .LP meillo@28: .sp 3 meillo@28: Source (in German): meillo@28: .CW "\s-1http://debianforum.de/forum/viewtopic.php?t=117683 meillo@24: meillo@24: meillo@28: .S "Various meillo@27: .LP meillo@27: Who uses meillo@27: .CW "grep -R meillo@27: ? meillo@27: .sp 1 meillo@27: .LP meillo@27: .CW "cat -v meillo@27: meillo@27: .sp 1 meillo@27: .LP meillo@27: Pagers are taken for granted meillo@27: meillo@27: .sp 1 meillo@27: .LP meillo@27: What about the readline? meillo@27: meillo@27: meillo@27: meillo@24: .S "MH / nmh meillo@24: .LP meillo@27: A Mail User Agent (MUA) meillo@25: .LP meillo@27: Is a toolchest meillo@25: .LP meillo@27: Work with mails like with generic files meillo@25: .LP meillo@27: The only(?) MUA that follows the Unix Phil meillo@25: .LP meillo@27: Has a very special feeling meillo@24: meillo@24: meillo@24: .S "uzbl meillo@24: .LP meillo@27: A web browser that adheres to the Unix Phil meillo@25: .LP meillo@27: A young project (about 1 year) meillo@25: .LP meillo@27: Central question: meillo@27: .br meillo@27: What is the one task a web browser covers? meillo@25: .LP meillo@27: Makes very visible use of software leverage meillo@25: .LP meillo@27: Suffers hard from our broken web meillo@24: meillo@24: meillo@24: meillo@24: meillo@24: meillo@28: .P "Final thoughts meillo@24: meillo@24: meillo@28: .S "Say no meillo@25: .LP meillo@28: In today's computer world, following the Unix Phil means often asceticism meillo@25: .LP meillo@27: One needs to abjure a lot of ``nice'' features meillo@27: .LP meillo@28: Actually, it is abjuring the *bad* features meillo@25: .LP meillo@28: Leads to a valuable attitude, IMO meillo@27: .LP meillo@27: .sp 2 meillo@27: Transfer it to your everyday life meillo@25: meillo@25: meillo@27: .S "Avoid complexity meillo@25: .LP meillo@27: Avoid complexity first and foremost meillo@25: .LP meillo@27: Complexity is the ``boss enemy'', software developers fight against meillo@25: .LP meillo@27: Strive for simplicity, clarity, generality meillo@27: .LP meillo@27: .sp 2 meillo@27: Transfer it to your everyday life meillo@25: meillo@25: meillo@27: .S "Good solutions meillo@25: .LP meillo@27: We don't need just solutions, we need good ones meillo@25: .LP meillo@27: Today, we can make almost everything possible, meillo@26: but we still cannot make it good meillo@27: .LP meillo@27: .sp 2 meillo@27: Transfer it to your everyday life meillo@25: meillo@25: meillo@28: .S "Live it meillo@25: .LP meillo@28: The Unix Phil is more than just a few guidelines meillo@25: .LP meillo@28: You cannot follow only some of the tenets meillo@25: .LP meillo@28: To understand the Unix Phil, you need to engage with it meillo@25: .LP meillo@28: .sp 4 meillo@25: .ce meillo@28: .B meillo@27: It's a philosophy \(en live it! meillo@24: meillo@24: meillo@24: meillo@28: meillo@28: meillo@28: .P "References meillo@24: meillo@24: meillo@27: .S Literature meillo@24: .I meillo@26: ``\fBThe Unix Philosophy\fP'' meillo@26: by Mike Gancarz meillo@26: .br meillo@26: Go and get it! meillo@24: .I meillo@26: ``\fBThe Unix Programming Environment\fP'' meillo@26: by Kernighan and Pike meillo@26: .br meillo@26: A Bible for Unix-lovers. meillo@24: .I meillo@26: ``\fBThe Mythical Man-Month\fP'' meillo@28: and ``\fBNo Silver Bullet\fP'' meillo@26: by Fred Brooks meillo@26: .br meillo@28: About complexity in software development. meillo@26: .I meillo@26: ``\fBThe Practice of Programming\fP'' meillo@26: by Kernighan and Pike meillo@26: .br meillo@26: How good code should look like. meillo@26: .I meillo@26: ``\fBcat -v Considered Harmful\fP'' meillo@26: by Pike and Kernighan meillo@26: .CW \s-2http://harmful.cat-v.org/cat-v/\s+2 meillo@26: .br meillo@26: A must-read. meillo@24: meillo@24: meillo@24: .S meillo@24: .LP meillo@27: This talk was prepared using tools of the Heirloom project: meillo@24: .CW \s-2http://heirloom.sf.net\s+2 meillo@24: .LP meillo@27: 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@27: 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@27: .LP meillo@27: See my paper on the topic, too. meillo@24: meillo@27: .sp 2 meillo@24: 2010-03-08