The UNIX Hater’s Handbook – un bon moment !
Compte rendu d’une lecture récente. Et super-amusante !
UNIX est un monde en soi, avec ses règles inattendues, son efficacité qui reste à prouver et ses illogismes. Vous qui avez pas mal de bouteille en informatique et qui ne comprenez toujours pas UNIX, lisez la suite ci-dessous… Je ne suis pas sûr que vous comprendrez enfin UNIX, mais en tout cas, vous devriez sourire pas mal de fois !
Beaucoup, beaucoup d’humour, pas mal de remarques justes et un peu de remise-des-pendules-à-l’heure…
Voici un livre qui ne mâche pas ses mots d’esprit à propos d’un système d’exploitation qui m’a longtemps semblé intimidant à force d’être irrationnel, j’ai nommé UNIX.
Ce livre est en vente sur Amazon, mais il est également possible de le télécharger en format pdf ici. Le tout se lit en un peu plus d’un jour. Voici les passages que j’ai notés. Je les livre avec mes réflexions d’alors. J’espère que vous passerez également un bon moment en les lisant !
La clientèle originale de UNIX.
- You know the real trouble with Unix? The real trouble is that it became so popular. It wasn’t meant to be popular. It was meant for a few folks working away in their labs, using Digital Equipment Corporation’s old PDP-11computer.
Bel exemple de réflexion académique (comme si le développement de logiciels ne comportait pas en soi suffisamment de contraintes).
- The PDP-11 had 16,000 words of memory. That was a fantastic advanceover my PDP-4 that had 8,000. The Macintosh on which I type this has 64MB: Unix was not designed for the Mac. What kind of challenge is there when you have that much RAM?
UNIX est au moins étrange mais cela s’explique.
- Unix was designed before the days of CRT displays on the console. For many of us, the main input/output device was a 10-character/second, all uppercase teletype (advanced users had 30-character/second teletypes, with upper and lowercase, both). No, those were the real days of computing. And those were the days of Unix. Look at Unix today: the remnants are still there. Try logging in with all capitals. Many Unix systems will still switch to an all-caps mode. Weird.
Il n’y a que Mac pour planter avec élégance, je le concède.
- As for me? I switched to the Mac. No more grep, no more piping, no more SED scripts. Just a simple, elegant life: “Your application has unexpectedly quit due to error number –1. OK?”
Quand on ne connait pas autre chose, UNIX, c’est quand même bien.
- “I liken starting one’s computing career with Unix, say as an under-graduate, to being born in East Africa. It is intolerably hot, yourbody is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act.”— Ken Pier, Xerox PARC
Quel est le meilleur OS pour gérer un réseau ? UNIX, bien sûr.
- Each graft of a new subsystem onto the underlying core has resulted in either rejection or graft vs. host disease with its concomitant proliferation of incapacitating scar tissue. The Unix networking model is a cacophonous Babel of Unreliability that quadrupled the size of Unix’s famed compact kernel.
UNIX n’est pas responsable de vos fautes de frappe, sachez-le.
- If you have ever used a Unix system, you have probably had the same nightmarish experiences that we have had and heard. You may have deleted important files and gone for help, only to be told that it was your own fault, or, worse, a “rite of passage.” You may have spent hours writing a heart-wrenching letter to a friend, only to have it lost in a mailer burp, or,worse, have it sent to somebody else. We aim to show that you are not alone and that your problems with Unix are not your fault.
Tu n’adoreras pas d’autre dieu.
- Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it.
L’une des phrases les plus marrantes de ce livre (et ce n’est pas parce qu’on rit que c’est drôle !).
- It might be the case that every once in a while these companies allow a programmer to fix a bug rather than apply for a patent, so some of the more superficial problems we document in this book might not appear in a particular version of Unix from a particular supplier.That doesn’t really matter, since that same supplier probably introduced a dozen other bugs making the fix.
De l’origine de UNIX :
- Two of the most famous products of Berkeley are LSD and Unix. I don’t think that this is a coincidence.
Comment assurer le succès d’un OS :
- While Unix spread like a virus, its adoption by so many can only be described by another metaphor: that of a designer drug. Like any good drug dealer, AT&T gave away free samples of Unix to university types during the 1970s.
On ne le dira jamais assez souvent :
- The wonderful thing about standards is that there are so many ofthem to choose from.
UNIX, ou la portabilité :
- I think Unix and snowflakes are the only two classes of objects in the universe in which no two instances ever match exactly.
D’où vient cette manie d’assurer une portabilité dont presque personne n’a besoin ?
- The evaluation process consisted largely of trying to get their test program, which was an early prototype of the product, to compile and run on the various *nixes. Piece of cake, sez I. But oops, one vendor changed all the argument order around on this class of system functions. And gee, look at that: A bug in the Xenix compiler prevents you from using byte-sized frobs here; you have to fake it out with structs and unions and things. Well, what do you know, Venix’s pseudo real-time facilities don’t work at all; you have to roll your own. Ad nauseam.
La beauté d’un rm ou d’un ls laisse pantois.
- The novice Unix user is always surprised by Unix’s choice of command names. No amount of training on DOS or the Mac prepares one for the majestic beauty of cryptic two-letter command names such as cp, rm, and ls.
Les claviers d’alors étaient un peu rude, d’où sans doute la propension des auteurs de UNIX à utiliser des commandes courtes :
- Those of us who used early 70s I/O devices suspect the degeneracy stems from the speed, reliability, and, most importantly, the keyboard of the ASR-33 Teletype, the common input/output device in those days. Unlike today’s keyboards, where the distance keys travel is based on feedback principles, and the only force necessary is that needed to close a micro switch, keys on the Teletype (at least in memory) needed to travel over half an inch, and take the force necessary to run a small electric generator such as those found on bicycles. You could break your knuckles touchtyping on those beasts.
Le coût d’un octets en dollars d’aujourd’hui est impressionnant.
- If Dennis and Ken had a Selectric instead of a Teletype, we’d probably be typing “copy” and “remove” instead of “cp” and “rm.”Ken Thompson was once asked by a reporter what he would have changed about Unix if he had it all to do over again. His answer: “I would spell creat with an ‘e.’”
Ça nous est tous plus ou moins arrivé. Nous en rions encore, d’ailleurs.
- Anybody else ever intend to type: % rm *.o and type this by accident: % rm *>o. Now you’ve got one new empty file called “o”, but plenty of room for it!
Petite expression sympatique en passant (belle alternative au RTFM habituel) :
- People vote for president more often than they read printed documentation.
Vous utilisez man et vous ne trouvez pas ? Rassurez-vous, nous non plus.
- What documentation was actually written—the infamous Unix “man pages”—was really nothing more than a collection of reminders for people who already knew what they were doing. The Unix documentation was so concise that you could read it all in an afternoon.
X Windows à la rescousse.
- If the designers of X Windows built cars, there would be no fewer than five steering wheels hidden about the cockpit, none of which followed the same principles — but you’d be able to shift gears with your car stereo. Useful feature, that.
Un peu comme Windows 3.0 servait surtout à jouer à solitaire…
- Ten years later, most computers running X run just four programs: xterm, xload, xclock, and a window manager. And most xterm windows run Emacs! X has to be the most expensive way ever of popping up an Emacs window.
Je vous donne X Windows et je vous vends un processeur plus rapide en prime.
- After all, what better way is there to force users to upgrade their hardware than to give them X, where a single application can bog down the client, the server, and the network between them, simultaneously!
Au moins, UNIX a été développé par des informaticiens passionnés – c’est rudement bien construit.
- Programming X Windows is like trying to find the square root of pi using roman numerals.
UNIX est composé de petits programmes ne sachant faire qu’une seule chose mais le faisant bien.
- The Unix “power tool” metaphor is a canard. It’s nothing more than a slogan behind which Unix hides its arcane patchwork of commands and adhoc utilities.
Pour preuve, ls :
- ls, a program that once only listed files, now has more than 18 different options that control everything from sort order to the number of columns in which the printout appears—all functions that are better handled with othertools (and once were).
L’open source, c’est l’avenir.
- Hardware stores contain screwdrivers or saws made by three or four different companies that all operate similarly. A typical Unix /bin or /usr/bin directory contains a hundred different kinds of programs, written by dozens of egotistical programmers, each with its own syntax, operating paradigm, rules of use (this one works as a filter, this one works on temporary files, etc.), different strategies for specifying options, and different sets of constraints.
UNIX, c’est un peu le plaisir de passer 6 heures à lacer fichtrement bien une chaussure.
- And, indeed, that is my memory of Unix tools—you spend all your time learning to do complex and peculiar things that are, in the end, not really all that impressive. I decided I’d rather learn to get some real work done.
Évidemment, si vous savez pas où vous avez copié vos fichiers, vous l’aurez quand même un peu cherché.
- The Apple Macintosh and Microsoft Windows have powerful file locators that are relatively easy to use and extremely reliable. These file finders were designed with a human user and modern networking in mind. The Unix file finder program, find, wasn’t designed to work with humans, but with cpio—a Unix backup utility program. Find couldn’t anticipate networks or enhancements to the file system such as symbolic links; even after extensive modifications, it still doesn’t work well with either. As a result, despiteits importance to humans who’ve misplaced their files, find doesn’t workreliably or predictably.
On se demande quand même pourquoi Microsoft domine le marché des OS.
- The Unix kernel sources (in particular, the Berkeley Network Tape 2 sources available from ftp://ftp.uu.net/) are mostly uncommented, do not skip any lines between “paragraphs” of code, use plenty of goto’s, and generally try very hard to be unfriendly to people trying to understand them.
La fiabilité de UNIX est proverbiale.
- There is an amusing article in the December 1990 issue of Communications of the ACM entitled “An Empirical Study of the Reliability of Unix Utilities” by Miller, Fredriksen, and So. They fed random input to a number of Unix utility programs and found that they could make 24-33%(depending on which vendor’s Unix was being tested) of the programs crash or hang. Occasionally the entire operating system panicked.
À propos du C et du C++.
- Q. Where did the names “C” and “C++” come from? A. They were grades.
De la suffisance de certains (trop nombreux !) programmeurs :
- C++ users, alas, are forced to pick up their garbage manually. Many have been brainwashed into thinking that somehow this is more efficient than using something written by experts especially for the platform they use.These same people probably prefer to create disk files by asking for platter, track, and sector numbers instead of by name. It may be more efficient once or twice on a given configuration, but you sure wouldn’t want to use a word processor this way. You don’t even have to take our word for it. Go read The Measured Cost of Conservative Garbage Collection by B. Zorn (Technical Report CU-CS-573-92, University of Colorado at Boulder) which describes the results of as tudy comparing performance of programmer-optimized memory management techniques in C versus using a standard garbage collector. C programmers get significantly worse performance by rolling their own.
C++, l’enfant naturel de UNIX.
- That’s because C++ misses the point of what being object-oriented was all about. Instead of simplifying things, C++ sets a new world record for complexity. Like Unix, C++ was never designed, it mutated as one goofy mistake after another became obvious. It’s just one big mess of after thoughts. There is no grammar specifying the language (something practically all other languages have), so you can’t even tell when a given line of code is illegitimate or not.
C++, ou comment être plus rétro que Modula-2 dix ans plus tard.
- Of course, you have to put half of your code in the header files, just to declare your classes to the rest of the world. Well, of course, the public/private distinctions provided by a class declaration are worthless since the private information is in the headers and is therefore public information. Once there, you’re loathe to change them, thereby forcing a dreaded recompile. Programmers start to go to extraordinary lengths to add or change functionality through twisted mechanisms that avoid changing th eheaders. They may run into some of the other protection mechanisms, but since there are so many ways to bypass them, these are mere speed bumpsto someone in a hurry to violate protocol. Cast everything as void* and presto, no more annoying type checking.
UNIX et ROI ne font pas toujours bon ménage.
- A Unix sysadmin’s job isn’t fundamentally different from sysadmins who oversee IBM mainframes or PC-based Novell networks. But unlike these other operating systems, Unix makes these tasks more difficult and expensive than other operating systems do. The thesis of this chapter is that the economics of maintaining a Unix system is very poor and that the overall cost of keeping Unix running is much higher than the cost of maintaining the hardware that hosts it.
ROI et UNIX :
- According to one estimate, every 10-25 Unix workstations shipped create at least one full-time system administration job, making system administration a career with a future. Of course, a similar network of Macs or PCs also requires the services of a person to perform sysadmin tasks. But this person doesn’t spend full time keeping everything running smoothly, keeping Unix’s entropy level down to a usable level.This person often has another job or is also a consultant for many applications.
En tout cas, UNIX est un OS sécuritaire !
- The term “Unix security” is, almost by definition, an oxymoron because the Unix operating system was not designed to be secure, except for the vulnerable and ill-designed root/rootless distinction.
- Two fundamental design flaws prevent Unix from being secure. First, Unix stores security information about the computer inside the computer itself, without encryption or other mathematical protections. It’s like leaving the keys to your safe sitting on your desk: as soon as an attacker breaksthrough the Unix front door, he’s compromised the entire system. Second,the Unix superuser concept is a fundamental security weakness. Nearly all Unix systems come equipped with a special user, called root, that circumvents all security checks and has free and total reign of the system. The superuser may delete any file, modify any programs, or change any user’s password without an audit trail being left behind.
Pas de demi-mesure coté sécurité chez UNIX. Tous les pouvoirs ou rien !
- All multiuser operating systems need privileged accounts. Virtually all multiuser operating systems other than Unix apportion privilege according to need. Unix’s “Superuser” is all-or-nothing. An administrator who can change people’s passwords must also, by design, be able to wipe out everyfile on the system. That high school kid you’ve hired to do backups mightaccidentally (or intentionally) leave your system open to attack.
- The Unix concept called SUID, or setuid, raises as many security problems as the superuser concept does. SUID is a built-in security hole that provides a way for regular users to run commands that require special privileges to operate. When run, an SUID program assumes the privileges of the person who installed the program, rather than the person who is running the pro-gram. Most SUID programs are installed SUID root, so they run with superuser privileges.
- Experience has shown that most of Unix’s security flaws come from SUID programs.
Cela dit, UNIX est surtout un système robuste et performant.
- If you have an account on a Unix computer, you can bring it to a halt by compiling and running the following program: main(){while(1){fork();}}.
UNIX maîtrise particulièrement bien le système de fichiers.
- The traditional Unix file system is a grotesque hack that, over the years, has been enshrined as a “standard” by virtue of its widespread use. Indeed, after years of indoctrination and brainwashing, people now accept Unix’s flaws as desired features.