docs/unix-phil

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

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