162 csh, pipes, and find Pipes are good for simple hacks, like passing around simple text streams, but not for building robust software. For example, an early paper on pipes showed how a spelling checker could be implemented by piping together several simple programs. It was a tour de force of simplicity, but a horrible way to check the spelling (let alone correct it) of a document. Pipes in shell scripts are optimized for micro-hacking. They give program- mers the ability to kludge up simple solutions that are very fragile. That’s because pipes create dependencies between the two programs: you can’t change the output format of one without changing the input routines of the other. Most programs evolve: first the program’s specifications are envisioned, then the insides of the program are cobbled together, and finally somebody writes the program’s output routines. Pipes arrest this process: as soon as somebody starts throwing a half-baked Unix utility into a pipeline, its out- put specification is frozen, no matter how ambigious, nonstandard, or inef- ficient it might be. Pipes are not the be-all and end-all of program communication. Our favor- ite Unix-loving book had this to say about the Macintosh, which doesn’t have pipes: The Macintosh model, on the other hand, is the exact opposite. The system doesn’t deal with character streams. Data files are extremely high level, usually assuming that they are specific to an application. When was the last time you piped the output of one program to another on a Mac? (Good luck even finding the pipe symbol.) Pro- grams are monolithic, the better to completely understand what you are doing. You don’t take MacFoo and MacBar and hook them together. —From Life with Unix, by Libes and Ressler Yeah, those poor Mac users. They’ve got it so rough. Because they can’t pipe streams of bytes around how are they ever going to paste artwork from their drawing program into their latest memo and have text flow around it? How are they going to transfer a spreadsheet into their memo? And how could such users expect changes to be tracked automatically? They cer- tainly shouldn’t expect to be able to electronically mail this patched- together memo across the country and have it seamlessly read and edited at the other end, and then returned to them unscathed. We can’t imagine how they’ve been transparently using all these programs together for the last 10 years and having them all work, all without pipes.
Pipes 163 When was the last time your Unix workstation was as useful as a Macin- tosh? When was the last time it ran programs from different companies (or even different divisions of the same company) that could really communi- cate? If it’s done so at all, it's because some Mac software vendor sweated blood porting its programs to Unix, and tried to make Unix look more like the Mac. The fundamental difference between Unix and the Macintosh operating system is that Unix was designed to please programmers, whereas the Mac was designed to please users. (Windows, on the other hand, was designed to please accountants, but that’s another story.) Research has shown that pipes and redirection are hard to use, not because of conceptual problems, but because of arbitrary and unintuitive limita- tions. It is documented that only those steeped in Unixdom, not run-of-the- mill users, can appreciate or use the power of pipes. Date: Thu, 31 Jan 91 14:29:42 EST From: Jim Davis jrd@media-lab.media.mit.edu To: UNIX-HATERS Subject: Expertise This morning I read an article in the Journal of Human-Computer Interaction, “Expertise in a Computer Operating System,” by Stephanie M. Doane and two others. Guess which operating system she studied? Doane studied the knowledge and performance of Unix novices, intermediates, and expert users. Here are few quotes: “Only experts could successfully produce composite commands that required use of the distinctive features of Unix (e.g. pipes and other redirection symbols).” In other words, every feature that is new in Unix (as opposed to being copied, albeit in a defective or degenerate form from another operat- ing system) is so arcane that it can be used only after years of arcane study and practice. “This finding is somewhat surprising, inasmuch as these are fundamental design features of Unix, and these features are taught in elementary classes.” She also refers to the work of one S. W. Draper, who is said to have believed, as Doane says: