docs/unix-phil

annotate unix-phil-slides.ms @ 31:0caa9760fca8

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