docs/unix-phil

view unix-phil-slides.ms @ 27:e8adc3571e8c

rework
author meillo@marmaro.de
date Mon, 08 Mar 2010 12:58:58 +0100
parents b368ff5cdb5f
children faff9ea75591
line source
1 .TL
2 \fR\s-6Why\s0\fP
3 .br
4 the Unix Philosophy
5 .br
6 .vs -4
7 \fR\s-6still matters\s0\fP
8 .AU
9 .ft R
10 .sp 1.2i
11 .ps 11
12 markus schnalke <meillo@marmaro.de>
15 .S "Goals of this talk
16 .I
17 Introduce the Unix Phil
18 .I
19 Show that most modern software is crap
20 .I
21 Explain why the Unix Phil leads to better software
22 .I
23 Convince you that good software is of matter
24 .sp 2
25 .I
26 Make you think
29 .S "Roadmap
30 .I
31 Historical background
32 .I
33 What is the Unix Phil?
34 .I
35 The Unix Phil after Gancarz
36 .I
37 Discussion on real world examples
38 .I
39 The Unix Phil is more than software dev guidelines
43 .S "How I learned about it
44 .LP
45 First contact through dwm (suckless project)
46 .LP
47 ``cat -v Considered Harmful''
48 .LP
49 ``The Unix and the Echo''
50 .LP
51 ``The Unix Programming Environment''
52 .sp 1
53 .LP
54 Better understanding through digging in the past
60 .P "Historical background
65 .S "Historical background
66 .LP
67 The late 60s and early 70s
68 .LP
69 Operating systems are complex
70 .LP
71 Brooks' ``The Mythical Man-Month''
72 .LP
73 MULTICS had just failed
74 .LP
75 A lot of different hardware
76 .LP
77 Limited computing power
78 .LP
79 Textual input and output (line printers)
82 .S "Everything is a file
83 .LP
84 Is the(?) basic concept in Unix (and even more in Plan9)
85 .LP
86 Made simple operating systems possible
87 .LP
88 It is not covered by the Unix Phil
89 .br
90 The Unix Phil is on a different level
91 .sp 2
92 .LP
93 Unix is mainly two things:
94 .I
95 An operating system (system calls)
96 .I
97 A toolchest (coreutils)
101 .P "What is the Unix Phil?
105 .S "What is the Unix Phil *itself*?
106 .LP
107 ``The Unix philosophy is a set of cultural norms and philosophical
108 approaches to developing software based on the experience of
109 leading developers of the Unix operating system.''
110 (wikipedia)
111 .sp 2
112 .LP
113 How the inventors of Unix write software.
114 .LP
115 Common things of classic Unix tools.
116 .sp 2
117 .LP
118 Difficult to define
121 .S "Unix Phil vs. SW dev processes
122 .LP
123 The Unix Phil
124 .I
125 much: *what* to program
126 .I
127 few: *how* to program
129 .LP
130 Software developments processes:
131 .I
132 few: *what* to program
133 .I
134 much: *how* to program
136 .sp 2
137 .LP
138 Extreme Programming is like the Unix Phil
139 but with more *how* than *what*,
140 and with formalisms
146 .S "What is the Unix Phil?
147 .I
148 Doug McIlroy (1978)
149 .I
150 Mike Gancarz: ``The Unix Philosophy'' (1994)
151 .I
152 Eric S. Raymond: ``The Art of Unix Programming'' (2003)
153 .sp 2
154 .I
155 Richard Gabriel: ``Worse is Better'' (1989)
158 .S "Doug McIlroy
159 .LP
160 This is the Unix philosophy:
161 .I
162 Write programs that do one thing and do it well.
163 .I
164 Write programs to work together.
165 .I
166 Write programs to handle text streams, because that is a universal interface.
169 .S "Mike Gancarz: ``The Unix Philosophy''
170 .I
171 Small is beautiful.
172 .I
173 Make each program do one thing well.
174 .I
175 Build a prototype as soon as possible.
176 .I
177 Choose portability over efficiency.
178 .I
179 Store data in flat text files.
180 .I
181 Use software leverage to your advantage.
182 .I
183 Use shell scripts to increase leverage and portability.
184 .I
185 Avoid captive user interfaces.
186 .I
187 Make every program a filter.
188 .sp 1
189 .LP
190 Plus ten lesser tenets
195 .P "The Unix Phil after Gancarz
199 .S "Small is beautiful
200 .LP
201 Small software is easier to understand, write, maintain
202 .LP
203 Less lines of code contain less bugs
204 .LP
205 Monsters are large
208 .S "Make each program do one thing well
209 .LP
210 Programs with many functions are large
211 .LP
212 One thing is easier to understand
213 .LP
214 Often straight forward to implement
215 .LP
216 Reusable
219 .S "Build a prototype as soon as possible
220 .LP
221 Shows the quality of the design
222 .LP
223 Shows the problems of the software
224 .LP
225 The best way to shape a software
226 .LP
227 Users find bugs
230 .S "Choose portability over efficiency
231 .LP
232 (Originates in a lot of incompatible hardware in history)
233 .LP
234 Use is most important
235 .LP
236 Availability
237 .LP
238 Only needs to be fast enough
241 .S "Store data in flat text files
242 .LP
243 Binary data is machine-dependent
244 .LP
245 Human readable data is:
246 .I
247 As generic as possible
248 .I
249 Is very likely supported
250 .I
251 Many tools work on it (Unix toolchest)
252 .I
253 Directly editable by humans
254 .LP
255 Processing needs only to be fast enough
258 .S "Use software leverage to your advantage
259 .LP
260 What do we have computers for?
261 .LP
262 Make best use of computing power
263 .LP
264 Reduce development effort
267 .S "Use shell scripts to increase leverage and portability
268 .LP
269 Was very important in history
270 .LP
271 High level languages
272 .LP
273 Prototyping
274 .LP
275 Quick hacks
278 .S "Avoid captive user interfaces
279 .LP
280 Don't assume the user to be human
281 .LP
282 Exclude the user whenever possible
283 .LP
284 Automate
287 .S "Make every program a filter
288 .LP
289 Programs transform data
290 .LP
291 Combine programs
292 .LP
293 Have one common interface
297 .P "real world examples
300 .S "find -printf
301 .LP
302 How to reformat the output of find(1) to have ``FILENAME PATH''
303 instead of ``PATH/FILENAME''?
305 .LP
306 The ``easy'' way:
307 \f(CWfind /dir -printf "%P %h\en"\fP
309 .LP
310 The ``good'' way:
311 .br
312 .CW "\s-1find /dir | sed 's,\e(.*\e)/\e(.*\e),\e2 \e1,'
314 .LP
315 The difference shows off when one wants, for instance,
316 the path to be manipulated further.
319 .S "various
320 .LP
321 Who uses
322 .CW "grep -R
323 ?
324 .sp 1
325 .LP
326 .CW "cat -v
328 .sp 1
329 .LP
330 Pagers are taken for granted
332 .sp 1
333 .LP
334 What about the readline?
338 .S "MH / nmh
339 .LP
340 A Mail User Agent (MUA)
341 .LP
342 Is a toolchest
343 .LP
344 Work with mails like with generic files
345 .LP
346 The only(?) MUA that follows the Unix Phil
347 .LP
348 Has a very special feeling
351 .S "uzbl
352 .LP
353 A web browser that adheres to the Unix Phil
354 .LP
355 A young project (about 1 year)
356 .LP
357 Central question:
358 .br
359 What is the one task a web browser covers?
360 .LP
361 Makes very visible use of software leverage
362 .LP
363 Suffers hard from our broken web
369 .P "Some final thoughts
372 .S "Say no!
373 .LP
374 In today's computer world, the Unix Phil is often asceticism
375 .LP
376 One needs to abjure a lot of ``nice'' features
377 .LP
378 Actually it is abjuring the bad solutions
379 .LP
380 IMO that leads to a valuable attitude
381 .LP
382 .sp 2
383 Transfer it to your everyday life
386 .S "Avoid complexity
387 .LP
388 Avoid complexity first and foremost
389 .LP
390 Complexity is the ``boss enemy'', software developers fight against
391 .LP
392 Strive for simplicity, clarity, generality
393 .LP
394 .sp 2
395 Transfer it to your everyday life
398 .S "Good solutions
399 .LP
400 We don't need just solutions, we need good ones
401 .LP
402 Today, we can make almost everything possible,
403 but we still cannot make it good
404 .LP
405 .sp 2
406 Transfer it to your everyday life
409 .S "Live it!
410 .LP
411 The Unix Phil is not just a few guidelines
412 .LP
413 You cannot follow just some of the tenets
414 .LP
415 You will not understand the Unix Phil when you don't engage with it
416 .sp 3
417 .LP
418 .ce
419 It's a philosophy \(en live it!
423 .P "Appendix
426 .S Literature
427 .I
428 ``\fBThe Unix Philosophy\fP''
429 by Mike Gancarz
430 .br
431 Go and get it!
432 .I
433 ``\fBThe Unix Programming Environment\fP''
434 by Kernighan and Pike
435 .br
436 A Bible for Unix-lovers.
437 .I
438 ``\fBThe Mythical Man-Month\fP''
439 by Fred Brooks
440 .br
441 The case about complexity.
442 .I
443 ``\fBThe Practice of Programming\fP''
444 by Kernighan and Pike
445 .br
446 How good code should look like.
447 .I
448 ``\fBcat -v Considered Harmful\fP''
449 by Pike and Kernighan
450 .CW \s-2http://harmful.cat-v.org/cat-v/\s+2
451 .br
452 A must-read.
455 .S
456 .LP
457 This talk was prepared using tools of the Heirloom project:
458 .CW \s-2http://heirloom.sf.net\s+2
459 .LP
460 The slides macros are based on
461 .br
462 .CW \s-2http://repo.cat-v.org/troff-slider/\s+2
463 .sp
465 .LP
466 The slides are available on my website
467 .CW \s-2http://marmaro.de/docs\s+2
468 and on
469 .CW \s-2http://ulm.ccc.de/ChaosSeminar/\s+2
470 .sp
471 .LP
472 See my paper on the topic, too.
474 .sp 2
475 2010-03-08