UNIX programming art (preface)

zhaozj2021-02-16  53

Preface

Foreword

UNIX is not so much an operating system as an oral history.

--NEALSTephenson

Unix is ​​said to be an operating system, but it is better to say a history.

- Author: NealStephenson

There Is a Vast Difference Between Knowledge and Expertise. Knowledge letts you dedu The right shing to do; Expertise Makes The Right Thing a Reflex, Hardly Requiring Conscious Thought at all.

Knowledge and expertise have a big difference. Knowledge leads you to do the right thing; professional technology makes you correct things to reflex, almost no need to think.

This book has a lot of knowledge in it, but it is mainly about expertise. It is going to try to teach you the things about Unix development that Unix experts know, but are not aware that they know. It is therefore less about technicalia And More About Shared Culture Than Most Unix Books - Both Explicit and Implicit Culture, Both Conscious and Unconscious Traditions. It is not a 'how-to' book, it is a 'why-to' book.

This book involves a lot of knowledge, but mainly professional technology. It teaches you the technology developed by Unix, these technologies are experts, but they are not realized. Therefore, the skills involved in this book are relatively small. Compared with most UNIX books, this book is more shared culture - both externally and intrinsic culture, including conventions and hidden rules. It is not a book "how to do", but a book "why do" book.

The why-to has great practical importance, because far too much software is poorly designed. Much of it suffers from bloat, is exceedingly hard to maintain, and is too difficult to port to new platforms or extend in ways the original programmers did not Anticipate. Thase Problems. We Hope That Readers of this Book Will Learn Somethingy What UNIX HAS TO TEACH ABOUT Good Design.

"Why do you do" has a lot of practical value, because so far, quite a few software is designed very badly. Most of them are designed to be bloated, difficult to maintain, is difficult to transplant to new platforms, or when performing functional expansion, it is difficult to exceed the expectations of the initial programmers. We hope that the readers of this book learn some good things for UNIX design.

This book is divided into four parts: Context, Design, Tools, and Community The first part (Context) is philosophy and history, to help provide foundation and motivation for what follows The second part (Design) unfolds the principles of the Unix.. philosophy into more specific advice about design and implementation. The third part (Tools) focuses on the software Unix provides for helping you solve problems. The fourth part (Community) is about the human-to-human transactions and agreements that make the Unix culture So Effective at what it does. This book is divided into four parts: the dragon dense, design, tools and communities. The first part (in the dragon dermisy) tells the ideology and history, making the foundation for the subsequent chapter. The second part (design) is unfolding the principles and UNIX ideas, telling more detailed designs and implementations. Part III (Tool) Focus on UNIX can help you solve the problem. The fourth part (community) is about the exchanges and agreements between people and people, which make UNIX culture more angry.

Because this is a book about shared culture, I never planned to write it alone. You will notice that the text includes guest appearances by prominent Unix developers, the shapers of the Unix tradition. The book went through an extended public review process during which I invited these luminaries to comment on and argue with the text. Rather than submerging the results of that review process in the final version, these guests were encouraged to speak with their own voices, amplifying and developing and even disagreeing with the main line of the text .

Since this book is a book about sharing culture, I don't plan to write it alone. You will find it to include many UNIX developers and UNIX traditional founders. In the invitation of a large number of scholar comments, discussing the original text, this book has passed a long-term public review process. The final version of this book did not abandon the results in the review process. The guests were unhappy, enhanced, developed the main line of the original text, and of course the main line of the original text has caused certain differences.

In this book, WHEN I Use the ed ottis ibniscience but to one fect That it attempts to articulate the excertise of an entire community.

In this book, when I use "we" tone, it is not to be aware, but I just want to reflect a fact: try to clearly explain the consistent opinion of this community. Because this book is aimed at transmitting culture, it includes much more in the way of history and folklore and asides than is normal for a technical book Enjoy;. These things, too, are part of your education as a Unix programmer No single one. of the historical details is vital, but the gestalt of them all is important. We think it makes a more interesting story this way. More importantly, understanding where Unix came from and how it got the way it is will help you develop an intuitive feel For the unix style.

Because the purpose of this book is to transmit knowledge, in addition to a technical book, it also contains some history and legend. This is also part of UNIX programmer education, fully enjoying them. It is not that each historical information is critical, and their organic integration is very important. I think that in this way, you can create a more interesting story. More importantly, learn about Unix from the dragon to develop your intuition of Unix style.

For the same reason, we refuse to write as if history is over. You will find an unusually large number of references to the time of writing in this book. We do not wish to pretend that current practice reflects some sort of timeless and perfectly logical outcome of preordained destiny. References to time of writing are meant as an alert to the reader two or three or five years hence that the associated statements of fact may have become dated and should be double-checked.

The same reasons, I refused to write history will end. In this book you can find exotic about this information about this. I don't want to pretend to be more than the current practices can affect eternal and reasonable fate. The reference period of the work is intended to remind the reader, two years, three or five years, so the statement of the relevant facts may become expired, or doubled.

Other things this book is not is neither a C tutorial, nor a guide to the Unix commands and API. It is not a reference for sed or Yacc or Perl or Python. It's not a network programming primer, nor an exhaustive guide to the mysteries In addition, this book is not a c guidebook, nor a UNIX command and API guide. It is not a reference for Sed, Yacc, Perl or Python. It is not a network primary programming, nor a mysterious X guide, nor a book for the Unix architecture. Other books are better on these details, this book is only until.

Beyond all these technical specifics, the Unix culture has an unwritten engineering tradition that has developed over literally millions of man-years of skilled effort. This book is written in the belief that understanding that tradition, and adding its design patterns to your toolkit, will Help You Become A Better Programmer and Designer.

Beyond these technical details, UNIX culture has an incultiplexed engineering practice, which has developed millions of people's achievements on this basis. This book is officially written by the concept of this practice. And add its design model to your toolkit, which will help you become better programmers and designers.

Cultures consist of people, and the traditional way to learn Unix culture is from other people and through the folklore, by osmosis. This book is not a substitute for person-to-person acculturation, but it can help accelerate the process by allowing you to Tap the experience of others.

Culture is composed of people, and the traditional way of learning UNIX culture is to learn or relied on the legendary penetration from other people. This book is not an alternative to cultural adaptation between people, but allows you to accelerate your learning from your experience.

Who Should Read this book

Who should read this book?

You should read this book if you are an experienced Unix programmer who is often in the position of either educating novice programmers or debating partisans of other operating systems, and you find it hard to articulate the benefits of the Unix approach.

If you are a newcomer's UNIX programmer, when you argue with other operating systems, it is difficult to clear the benefits of UNIX, then you should read this book. You Should Read this Book if you are A C, C , or Java Programmer with experience on Other

Operating systems and you are about to start a unix-based project.

If you are a C, C or Java programmer, you have the experience of other operating systems and ready to turn to UNIX-based programming, then you should read this book.

You Should Read this Book if you are a unix user with novice-level up to middle-level Skills in

THE OPERATING SYSTEM, But Little Development Experience, And Want to Learn How To Design Software

Effectively Under Unix.

If you have UNIX primary levels, and I hope to reach the intermediate level on the operating system, but you have almost no experience, and you want to learn to develop software under UNIX, then you should read this book.

You Should Read this Book if you are a non-unix programer Who Has first this the unix

TRACH you. We believe You're Right, And That The Unix Philosophy

Can Be Exported to Other OPERATING SYSTEMS. SO WE WILL PAY More Attertion to Non-Unix Environments

(Especially Microsoft Operating Systems) Than Is Usual In a Unix Book; and when Tools and Case

Studies Are Portable, We Say SO.

If you are a recent UNIX tradition, you may teach you a lot of non-UNIX programmers, you should read this book. We believe that you are right, and UNIX thinking is equally applicable to other operating systems. Therefore, more general UNIX books we pay more attention to non-Unix environments (especially Microsoft operating systems), and we say that when tools and case studies become relaxed.

You should read this book if you are an application architect considering platforms or implementation strategies for a major general-market or vertical application. It will help you understand the strengths of Unix as a development platform, and of the Unix tradition of open source as a Developments.

If you are a system architect, you are considering application platforms and implementation strategies for mainstream markets or top applications, you should read this book. It helps you understand the power of development platform UNIX and UNIX to open source as the charm of development methods.

YOULD NOT READIOR HOW TOETHETHE ARE MANY GoOKing In There Are Many Good

UNIX Environment [Stevens92] IS Classic Among Explorations of The Unix API, and The Practice of

Programming [kernighan-pike99] is Recommended For All C Programmers (Indeed for ALL)

Programmers in any language).

If you are looking for the details of C language coding or how to use the UNIX core API, then you should not read this book. There are many good books on these topics. "Unix Environment Advanced Programming" [Stevens92] is a masterpiece in UNIX API books, "Programming Practice" [kernighan-Pike99] is a recommended reading of all C programmers (actually uses programmers using any language).

How to use this book

How to use this book

This book is both practical and philosophical Some parts are aphoristic and general, others will examine specific case studies in Unix development We will precede or follow general principles and aphorisms with examples that illustrate them:.. Examples drawn not from toy demonstration programs but rather from REAL WORKING CODE THAT IS in Use every day.

This book is pinned, and is a philosophical thinking. Some parts are the motto and summary, and others are a detailed example of UNIX development. We will explain examples after the general principles and general explanation. The example is not from the toy example, but the actual work code we used every day.

We have deliberately avoided filling the book with lots of code or specification-file examples, even though in many places this might have made it easier to write (and in some places perhaps easier to read!). Most books about programming give too many low -LEVEL DETAILS AND EXAMPLES, But Fail At Giving The Reader a High-Level Feel For What Really Going ON. In this book, we prefer To Err in the oppositive direction.

We deliberately avoid a lot of code and detailed document examples in the book, even in many places, if this will be easy to write (and many places easier to read). Most of the design books give too many low-level instances, so that the feeling of a high level of the reader has failed. In this book, we would rather make mistakes in this regard.

Therefore, while you will offten be invited to read code and specification files, relationive fliments. Instead, we point you at example on the web.

So, when you are often invited to read code and detailed files, this book actually includes little information on this. On the contrary, we pointed out where there is such an example.

Absorbing these examples will help solidify the principles you learn into semi-instinctive working knowledge. Ideally, you should read this book near the console of a running Unix system, with a Web browser handy. Any Unix will do, but the software case studies are more likely to be preinstalled and immediately available for inspection on a Linux system. The pointers in the book are invitations to browse and experiment. Introduction of these pointers is paced so that wandering off to explore for a while will not break up exposition that has To Be Continuous.

These interesting examples will be a good consolidation of knowledge that you have learned. In theory, when you read this book, you should be next to the Unix system console, and next to the help of a web browser. Any UNIX system can be, but these software examples have become more suitable under Linux systems. The indicator in this book requires you to browse and practice. The introduction of these indicators is far from the subject, but does not cut the continuity of the book.

Note: while we have made every effort to cite URLs that should remain stable and usable, there is no way we can guarantee this If you find that a cited link has gone stale, use common sense and do a phrase search with your favorite Web. Search Engine. WHERE POSSIBLE WE SUGGEST WAYS TO DO this Near The Urls We Cite.

Note: When we try to quote the URL, it should keep it stable and available, but in fact, we have no way to ensure this. If you find a link is not available, you can use your favorite Web search engine to find it. When we are in the reference to the URL, we often recommend this.

.

Most abbreviations of this book are full names in the first use. For convenience, we also provide a glossary in the appendix.

References are usually by author name. Numbered FootNotes Are for Urls That Would Intrude ON

The Text or That We suspect might be perishable; Also for Asides, War Stories, And Jokes.2 Reference Refers to the author's name. A large number of possible expired or unavailable URLs have labeled footnotes, war stories and jokes.

To make this book more accessible to less non-program, we invited some non-proteme

Read It and Identify Terms That Seemed Both Obscure and Necessary To The Flow of Exposition. WE

Also Use Footnotes for Definitions of Elementary Terms That An Experienced Programmer IS Unlikely To

NEED.

In order to make this book more applicable to technology weak readers, we invited some non-service readers to read it, and either ambiguously either need to explain the terminology. We also use some footnotes that may not need to interpret the terminology.

Related References

Related reference

. Some famous papers and a few books by Unix's early developers have mined this territory before Kernighan & Pike's The Unix Programming Environment [Kernighan-Pike84] stands out among these and is rightly considered a classic But today it shows its age a bit;. It Doesn't Cover The Internet, And The World Wide Web or The New Wave of Interpreted Languages ​​Like Perl, Tcl, And Python.

Early some paper written by UNIX developers in these areas. The "UNIX programming environment" of Kernighan and Pike [kernighan-Pike84] is their outstanding representative, which is the most appropriate. But today it looks a bit old, it does not cover the tide of Internet, World Wide Web or interpretation, such as Perl, TCL, and Python.

About Halfway Into The Composition of this Book, We Learned of Mike Gancarz's The Unix Philosophy

[Gancarz]. This Book is Excellent With ITS Range, But Did Not Attempt to Cover The Full Spectrum

Of Topics We Felt Needed to Be Addressed. Nevertheless We Are Grateful To The Author for the Reminder

That The Very Simplest Unix Design Patterns Have Been The MOST PERSIStent and SUCCESSFUL ANES.

In this book, we learned the book of Mike Gancarz "UNIX Thought" [Gancarz]. This is quite excellent in the range involved, but unfortunately it doesn't tried to override all the topics we think should be mentioned. However, the author's implies of the easiest way of success in UNIX design patterns, we are very grateful.

The Pragmatic Programmer [Hunt-Thomas] is a witty and wise disquisition on good design practice pitched at a slightly different level of the software-design craft (more about coding, less about higher level partitioning of problems) than this book. The authors' Philosophy is an outgrowth of unix experience, and it is an excellent complement to this book. "The programmer's cultivation" [hunt-thomas] is a book about good design habits, it is very humble, very enlightened . Compared with this book, it is different from the level of software design technology (more is coding, the high level of problem is relatively small). The author's thoughts are the product of UNIX experience, this is the excellent supplement of this book.

The Practice of Programming [kernighan-Pike99] Covers Some of the Same Ground As the Pragmatic

PROGRAMER from a position deep within the unix tradition.

"Programming Practice" [kernighan-Pike99] covers some of the same UNIX traditional in-depth studies of "programmers' cultivation".

Finally (and with admitted intent to provoke) we recommend Zen Flesh, Zen Bones [Reps-Senzaki], an important collection of Zen Buddhist primary sources. References to Zen are scattered throughout this book. They are included because Zen provides a vocabulary for addressing some ideas that turn out to be very important for software design but are otherwise very difficult to hold in the mind. Readers with religious attachments are invited to consider Zen not as a religion but as a therapeutic form of mental discipline-which, in its purest Non-theistic forms, is exactly what zen is.

Finally (with a certain purpose), we recommend "Zen, Fams and Corps" [REPS-SENZAKI], an important source of religious collection. Zero zero dispersed this book refers to Zen, which is included in the book because they provide a lot of expressions in software design, but others are difficult to grasp. It is recommended that readers with religious beliefs don't think Zen is a religion, but a pureheism's mental medical agent, which is the truly.

Conventions Used in this BOOK

This book is agreed

The term "UNIX" is technically and legally a trademark of The Open Group, and should formally be used only for operating systems which are certified to have passed The Open Group's elaborate standards-conformance tests. In this book we use "Unix" in the looser sense widely current among programmers, to refer to any operating system (whether formally Unix-branded or not) that is either genetically descended from Bell Labs's ancestral Unix code or written in close imitation of its descendants. in particular, Linux (from which we Draw Most Our Examples) IS A UNIX Under this Definition. The term Unix is ​​an open source organization's legitimate trademark, and should be regularly used in an operating system that is subjected to strict tests through the open source tissue. In this book, when it comes to the original UNIX code generated by the Bell Lab or the operating system thereof (whether it is a regular UNIX trademark) we use UNIX in a relatively loose environment. Special instructions, Linux (we use it to express a lot of examples) in line with this definition.

This book employs the Unix manual page convention of tagging Unix facilities with a following manual section in parentheses, usually on first introduction when we want to emphasize that this is a Unix command. Thus, for example, read "munger (1)" as " the 'munger' program, which will be documented in section 1 (user tools) of the Unix manual pages, if it's present on your system. "Section 2 is C system calls, section 3 is C library calls, section 5 is file formats and protocols, section 8 is system administration tools. Other sections vary among Unixes but are not cited in this book. For more, type man 1 man at your Unix shell prompt (older System V Unixes may require man -s 1 man).

This book is for the label Unix, borrows the UNIX guide page and indicates that in parentheses, usually in our first introduction, we emphasize this is a UNIX naming. In this way, for example, read "Munger (1)" as a "MUNGER" program, in the first part of the UNIX manual, if the UNIX manual exists on your system. The second part is that the C system call, the third part is the C library call, the fifth part is the file format and protocol, and the eighth part is the system management tool. The other parts varies between Unixes, but there is no reference in this book. More, enter the man 1 man shell command under your UNIX system (may be Man-S 1 Man on the Older System v Unixes). Sometimes we mention a Unix application (such as Emacs, without a manual-section suffix and capitalized. This is a clue that the name actually represents a well-established family of Unix programs with essentially the same function, and we are discussing generic properties of All of them. Emacs, for Example, INCLUDES XEMACS.

Sometimes we talk about UNIX applications (such as Emacs) without the manual paragraph enrichment and uppercase start letters. This is a clue, the name does represent the determined UNIX program family, essentially the same function, and we discuss all of their properties. For example, Emacs includes XEMACS.

At various points later in this book we refer to 'old school' and 'new school' methods. As with rap music, new-school starts about 1990. In this context, it's associated with the rise of scripting languages, GUIs, open- source Unixes, and the Web. Old-school refers to the pre-1990 (and especially pre-1985) world of expensive (shared) computers, proprietary Unixes, scripting in shell, and C everywhere. This difference is worth pointing out because cheaper And Less Memory Constrained Machines Have Wrought Some Significant Changes on the UNIX Programming Style.

In this book, we involve "old schools" and "new school" methods after a variety of different points. Like the fastboard song, "New School" began in approximately 1990. During this process, with the Scripting language, Guis, open source unixes and web grows, associated with them. "Old School" involves expensive computers before 1990 (especially 1985), all unixes, scripts in the shell and everywhere C. It is worth pointing out that it is cheap and smaller memory to facilitate some important changes in UNIX program style.

Our Case Studies

Our case study

A lot of books on programming rely on toy examples constructed specifically to prove a point. This one will not. Our case studies will be real, pre-existing pieces of software that are in production use every day. Here are some of the major Ons: Many programming books rely on constructing toy examples to support his argument, this book doesn't do this. Our case study will be true, we are in the part of the software works. It lists the main one.

cdrtools / xcdroast These two separate projects are usually used together The cdrtools package is a set of CLI tools for writing CD-ROMs;.. Web search for "cdrtools" The xcdroast application is a GUI front end for cdrtools; see the xcdroast project site [http://www.xcdroast.org/].

CDRTools / XcDroast These 2 related items are usually used together. The CDRTools Toolkit is a series of CLI about writing CD-ROMs; search "CDRTools" over the network. XcDroast Applications are a GUI front-end using CDRTools; refer to the XcDroast Engineering site [http://www.xcdroast.org/].

Fetchmail The fetchmail program retrieves mail from remote-mail servers using the POP3 or IMAP post-office protocols. See the fetchmail home page [http://www.catb.org/~esr/fetchmail] (or search for "fetchmail" on The Web).

The fetchmail fetchmail program uses the POP3 and IMAP post office protocols from the remote mail server to Mail. Check the home page of Fetchmail. [http://www.catb.org/~esr/fetchmail] (or find "fetchmail" on the Internet)

GIMP The GIMP (GNU Image Manipulation Program) is a full-featured paint, draw, and image-manipulation program that can edit a huge variety of graphical formats in sophisticated ways Sources are available from the GIMP home page [http:. // www .gimp.org /] (or search for "gimp" on the web).

GIMP GIMP (GNU Graphics Operating Procedure) is a full-featured painting, a graphics handler, which can be mysterious to process a variety of graphics formats. Source code can be obtained from the GIMP home page. [http://www.gimp.org/] (or find "gimp" online)

Mutt The mutt mail user agent is the current best-of-breed among text based Unix electronic mail agents, with notably good support for MIME (Multipurpose Internet Mail Extensions) and the use of privacy aids such as PGP (Pretty Good Privacy) and GPG (GNU Privacy Guard). Source Code and Executable Binaries Are Available At The Mutt Project Site [http://www.mutt.org] .mutt Mutt Mail User Agent is the best text-based UNIX email agent, for MIME (Multi-Used Network Mail Extensions) has considerable support and has privacy help, such as PRETTY Good Privacy, and GPG (GNU Privacy Guard). View the source code and executable binary files can be on the MUTT website [http://www.mutt.org].

xmlto The xmlto command renders DocBook and other XML documents in various output formats, including HTML and text and PostScript. For sources and documentation, see the xmlto project site [http://cyberelk.net/tim/xmlto/].

The XMLTO XMLTO commands presents DocBook and other documents, including HTML, text, and postscript. View the source code and documentation, you can go to XMLTO website [http://cyberelk.net/tim/xmlto/].

To minimize the amount of code the user needs to read to understand the examples, we have tried to choose case studies that can be used more than once, ideally to illustrate several different design principles and practices. For this same reason, many of the examples Are from My Projects. No Claim That Sests is Implied, Merely That I Find The Sufficiently Familiar To BE Useful for Multiple Expository Purposes.

In order to make the reader need to read the example as little, we tried to use an example of research more than once, perfect for several different design principles. The same reasons, these examples have a lot of self-self. If there is no particular indication, it is default. Just because I found that they are well suited to illustrate different purposes.

Author's Acknowledgements

Author's thanks

The guest contributors (Ken Arnold, Steven M. Bellovin, Stuart Feldman, Jim Gettys, Steve Johnson, Brian Kernighan, David Korn, Mike Lesk, Doug McIlroy, Marshall Kirk McKusick, Keith Packard, Henry Spencer, and Ken Thompson) added a great deal of value to this book. Doug McIlroy, in particular, went far beyond the call of duty in the thoroughness of his critique and the depth of his contributions, displaying the same care and dedication to excellence which he brought to managing the original Unix research group thirty years ago. guests (Ken Arnold, Steven M. Bellovin, Stuart Feldman, Jim Gettys, Steve Johnson, Brian Kernighan, David Korn, Mike Lesk, Doug McIlroy, Marshall Kirk McKusick, Keith Packard, Henry Spencer, and Ken Thompson ) Provide a lot of valuable parts for this book. Especially Doug Mcilroy, fully exceeded criticism and depth contribution, showing his level of concern like the excellent contribution of the original UNIX research group three years ago.

Special thanks go to Rob Landley and to my wife Catherine Raymond, both of whom delivered intensive line-by-line critiques of manuscript drafts. Rob's insightful and attentive commentary actually inspired more than one entire chapter in the final manuscript, and he had a lot to do with its present organization and range; if he had written all the text he pushed me to improve, I would have to call him a co-author Cathy was my test audience representing non-technical readers;. to the extent this book is Accessible to People Who Aren't Already Programmers, That's Largely Her doing.

Especially to thank Rob Landley and my wife Catherine Raymond, they all reviewed the paper. The deep indirect of ROB really makes the finals of the manuscript more inspiration, and it has a lot need to do in his current organization and scope. If he wrote all the words I want to improve, I can call him for half an author. Cathy is a non-technical reader and is my test audience. This book is to be readily available on the content of non-service, and is largely from her effort.

This book benefited from discussions with many other people over the five years it took me to write it. Mark M. Miller helped me achieve enlightenment about threads. John Cowan supplied some insights about interface design patterns and drafted the case studies of wily and VM / CMS, and Jef Raskin showed me where the Rule of Least Surprise comes from. The UIUC System Architecture Group contributed useful feedback on early chapters. The sections on What Unix Gets Wrong and Flexibility in Depth were directly inspired by their review. Russell J. Nelson contributed the material on Bernstein chaining in Chapter 7. Jay Maynard contributed most of the material in the MVS case study in Chapter 3. Les Hatton provided many helpful comments on the Languages ​​chapter and motivated the portion of Chapter 4 on Optimal Module Size. David A Surve Cox Helped Develop The Survey of Plan 9. Dennis Rusts IE Corrected Me on Some Historical Points About C. This book benefits from me and discuss with many people. He spent more than five years to write it. Mark M. Miller helps me complete the enlightenment of the idea. John Cowan provides an insight of interface design patterns, drafting examples of Wily and VM / CMS. Jef raskin told me where rule of least surprise came from. The UIUC system architecture group provides useful feedback on early chapters. (What UNIX Gets Wrong and Flexibility In Depth) section is directly slander than the inspiration of their review. Russell J. Nelson provides a lot of materials for Bernstein Chaining, Chapter VI. Jay MayNard provides vast majority of materials in the third chapter of MVS. Les Hatton provides a lot of useful comments to the Languages ​​chapters, which inspires part of the Optimal Module Size. David A. Wheeler provides many meaningful criticisms and some examples of research materials, especially in the design (Design). Russ Cox has developed Survey of Plan 9. Dennis Ritchie corrected some of my C's history.

Hundreds of Unix programmers, far too many to list here, contributed advice and comments during the book's public review period between January and June of 2003. As always, I found the process of open peer review over the Web both intensely challenging and intensely rewarding. Also as always, responsibility for any errors in the resulting work remains my own The expository style and some of the concerns of this book have been influenced by the design patterns movement;. indeed, I flirted with the idea of ​​titling the book Unix Design Patterns . I did not, because I disagree with some of the implicit central dogmas of the movement and do not feel the need to use all its formal apparatus or accept its cultural baggage. nevertheless, my approach has certainly been influenced by Christopher Alexander's work (especially the Timeless Way of Building and a pattern language, and i oowe the gang) use Alexander's insights to talk about software design at a high level without merely uttering vague and useless generalities Interested readers should see Design Patterns:.. Elements of Reusable Object-Oriented Software [GangOfFour] for an introduction to design patterns thousands of Unix Programmer, because there are too many unable to list. In the public review phase of January 2003, they contributed a lot of useful suggestions and comments. Therefore, I found that public reviews on the Web are both challenges and have a rich return. Moreover, the responsibility of any errors left in the results work. This book's instruction style and some books involve items have been influenced by the mode movement. Indeed, I hesitate to have the name of this book should be "UNIX design mode". I didn't do that, I didn't blindly from this sports dogma, and I think it doesn't have to accept his formal equipment and his cultural burden. However, my approach is of course affected by Christopher Alexander. (Especially the "Eternal Method" and "A Mode Language", I am attributed to the "Four Help" and other large points of guidelines I may use Alexander's insight in almost no vague high-level software design. Interest readers You can look at "Design Mode" and "Reusable Object-Oriented Software Principle" [Gangoffour].

The title of this book is, of course, a reference to Donald Knuth's The Art of Computer Programming. While not specifically associated with the Unix tradition, Knuth has been an influence on us all. Editors with vision and imagination are not as common as . they should be Mark Taub is one; he saw merit in a stalled project and skillfully nudged me into finishing it Copy editors with a good ear for prose style and enough ability to improve writing that is not like theirs are even less common,. but Mary Lou Nohr makes that grade. Jerry Votta seized on my concept for the cover and made it look better than I had imagined. The whole crew at Prentice-Hall gets high marks for making the editorial and production process as painless as possible, and For Cheerfully Accommodating My Control-Freak Tendencies Not Just Over The Text But Deep Into The Details of The Book's Visual Design, Art, And Marketing. This book is of course referring to Donald Knuth's Computer Programming Art. However, the UNIX traditional association is not very large, and Knuth has a great impact on us. The editor is not what they should be as ordinary. Mark Taub is one of them, she sees an interrupted project value and convince me to complete it. There is a copy of the prose style and enough ability to improve writing. Jerry Votta seized the core of my cover, and it is better than I imagined. All staff of Prentice-Hall have been highly evaluated in editing and publishing, in my text rather than the visual design of the book, the details of art and market details.

Chapter 1. Philosophy

Chapter II Thought

Philosophy Matters

Ideological problem

Those Who Do Not Und Unix Are Condemned To Reinvent It, Poorly.

--Henryspencer

Usenet signature, november 1987

Those who don't understand Unix often think that it is a repetition invention.

- HenrySpencer, 1987.11

Culture? What creted?

culture? What culture?

This Is A Book About Unix Programming, But in It We're Going to Toss Around The Words 'Culture', 'Art', And 'Philosophy' a Lot. If You Are Not a Programmer, or You Are A Program WHO HAS HAD little contact with the Unix world, this may seem strange But Unix has a culture;. it has a distinctive art of programming;. and it carries with it a powerful design philosophy Understanding these traditions will help you build better software, even if you ' re developing for a non-Unix platform. Every branch of engineering and design has technical cultures. In most kinds of engineering, the unwritten traditions of the field are parts of a working practitioner's education as important as (and, as experience grows, often more important than) the official handbooks and textbooks. Senior engineers develop huge bodies of implicit knowledge, which they pass to their juniors by (as Zen Buddhists put it) "a special transmission, outside the scriptures". this is a Unix programming book However, in this book we are not intended to discuss a lot around "culture", "art" and "thinking". If you are not a programmer, or you are a rare programmer who has been in contact with the UNIX, it may feel a little strange. But Unix has a culture that has different programming arts, and it carries a powerful design idea. Know that these traditions will help you better software, and you are developing software under a non-UNIX platform. The branches of each project design have technical culture. In many kinds of projects, informative provisions of the field are the practitioners' learning categories, which is equally important as official manuals and textbooks (and more and more important as experiences). Senior engineers have developed a large number of people confirmed as correct knowledge, these knowledge relied (as Zen Buddhists) "special way," outside the document "is transmitted to later.

Software engineering is generally an exception to this rule; technology has changed so rapidly, software environments have come and gone so quickly, that technical cultures have been weak and ephemeral There are, however, exceptions to this exception A very few software technologies have.. Proved Durable Enough To Evolve Strong Technical Cultures, DistINcTive Arts, and An Associated Design Philosophy Transmitted Across Generals Of Engineers. Software Engineering has gradually become the exceptional exception. The technology is updated so fast, the software environment is fast, and it is fast, and the technical culture becomes weak and short. However, there is also an exception outside. Some software technologies have proven to be developing enough and durable, with strong cultural culture, unique art, the associated design ideas spread through engineers.

The Unix culture is one of these The Internet culture is another -.. Or, in the twenty-first century, arguably the same one The two have grown increasingly difficult to separate since the early 1980s, and in this book we will not try Particularly hard.

Unix culture is one of them. Internet culture is another one, or said that in the 21st century, it can argue the same one. Since the 1980s, these two developments have become increasingly difficult, in this book, we don't want to work hard.

The durability of unix

UNIX's persistence force

Unix was born in 1969 and has been in continuous production use ever since That's several geologic eras by computer-industry standards -.. Older than the PC or workstations or microprocessors or even video display terminals, and contemporaneous with the first semiconductor memories Of all production timesharing systems today, only IBM's VM / CMS can claim to have existed longer, and Unix machines have provided hundreds of thousands of times more service hours; indeed, Unix has probably supported more computing than all other timesharing systems put together.

Since the birth of UNIX in 1969, it has been in research and utilization. There are several geographic regions against computer industry standards - earlier than PC or workstations or microprocessors or VIDEOs, and with the earliest semiconductor memory. In all products, today's time sharing system, only IBM's VM / CMS can be called longer, and UNIX machines have provided millions of service hours. Indeed, the service provided by UNIX is more than the service time provided by other time sharing systems. Unix has found use on a wider variety of machines than any other operating system can claim. From supercomputers to handhelds and embedded networking hardware, through workstations and servers and PCs and minicomputers, Unix has probably seen more architectures and more odd hardware than any three other Operating systems combined.

UNIX has been built on a wider machine, which is more than any other operating system. From supercomplers to handheld devices and embedded network hardware, Unix is ​​likely to see more process and unfixed hardware through workstations and PCs and microcomputers, which is likely to be combined more than other people. need more.

Unix has supported a mind-bogglingly wide spectrum of uses. No other operating system has shone simultaneously as a research vehicle, a friendly host for technical custom applications, a platform for commercial-off-the-shelf business software, and a vital component technology of the internet.

UNIX has provided a MIND-Boggling-range range. No other operating system has such research methods to customize the host, commercial software platform, and important components of the Internet technology for technical custom applications.

Confident predictions that Unix would wither away, or be crowded out by other operating systems, have been made yearly since its infancy. And yet Unix, in its present-day avatars as Linux and BSD and Solaris and MacOS X and half a dozen other variants SEEMS STRONGER THAN EVER TODAY. ROBERT METCALF [The Inventor of Ethernet] Says That IFETHING COMES ALONG to Replace Ethernet, IT Will Be Called "Ethernet", SO Therefore Ethernet Will Never Die.

Confident language, since the young age generated by UNIX, UNIX will finally wither, or in extrusion of other operating systems. However, UNIX, and his specific existence form, such as Linux, BSD, Solaris, Macos X and other half-family other operating systems, it seems to be strong than once, Robert Metcalf (inventors of Ethernet) If something comes out and replaces Ethernet, it will call "Ethernet", so the Ethernet will not die. 4 Unix Has Already undergone Several Such Transformations.

-Kethompson

UNIX has suffered a variety of different transformations.

---- KENTHOMPSON

At least one of Unix's central technologies - the C language - has been widely naturalized elsewhere Indeed it is now hard to imagine doing software engineering without C as a ubiquitous common language of systems programming Unix also introduced both the now-ubiquitous treeshaped file namespace.. With directory nodes and the pipeline for connecting programs.

At least one of UNIX core technology - has been extensive to other places. It is really a wide existence system programming language, it is difficult to imagine how the software project does not have C. UNIX also introduces the tree file namespace and connection programs for the tree file namespace and connection programs.

.. Unix's durability and adaptability have been nothing short of astonishing Other technologies have come and gone like mayflies Machines have increased a thousand fold in power, languages ​​have mutated, industry practice has gone through multiple revolutions - and Unix hangs in there, still producing, STILL PAYING THE BILLS, AND STILL Commanding Loyalty from Many of The Best and Brightest Software Technologists on The Planet.

There is no surprise for UNIX's persistence and adaptability. Other technologies are like flying, and they disappeared. The efficiency of the machine has increased by a thousand times. The language is also used. Industrial practice has also experienced a lot of revolution ----- and UNIX still stands there, still in production, still paying bills, still commanded from this planet The best and most robust software technology loyalty.

One of the many consequences of the exponential power-versus-time curve in computing, and the corresponding pace of software development, is that 50% of what one knows becomes obsolete over every 18 months. Unix does not abolish this phenomenon, but does do a good job of containing it.

Many of them later calculated one of the efficiency and time index growth curves, and the corresponding software development speed, one person knows that there will be half a month. Unix does not fill this phenomenon, but a good job in it. There's a bedrock of unchanging basics-languages, system calls, and tool invocations-that one can actually keep using for years, even decades Elsewhere it is impossible to predict what will be stable;. Even entire operating systems cycle out of use Under Unix. , there is a fairly sharp distinction between transient knowledge and lasting knowledge, and one can know ahead of time (with about 90% certainty) which category something is likely to fall in when one learns it. Thus the loyalty Unix commands.

There is no change in the foundation - language, system calls and tools, one person can use for several years, or even decades. In other things, it is impossible to predict what is a solid, even language and eternal knowledge. One person knows that it is superior (determined about 90%) some other things that can lead to it. This is the loyalty of the UNIX command.

Much of Unix's stability and success has to be attributed to its inherent strengths, to design decisions Ken Thompson, Dennis Ritchie, Brian Kernighan, Doug McIlroy, Rob Pike and other early Unix developers made back at the beginning; decisions that have been proven sound over and over. But just as much is due to the design philosophy, art of programming, and technical culture that grew up around Unix in the early days. This tradition has continuously and successfully propagated itself in symbiosis with Unix ever since.

UNIX stability and success attributed to its inner strength, attributed to its decisive designer, Ken Thompson, Dennis Ritchie, Brian Kernighan, Doug Mcilroy, Rob Pike, and other early UNIX developers. The decision has been confirmed again and again. As his design ideas, programming arts and technological culture accompanied by UNIX growth. UNIX traditions have been constantly promoting itself in cooperation with UNIX.

1. The three and a half decades between 1969 and 2003 is a long time. Going by the historical trend curve in number of Unix sites during that period, probably somewhere upwards of fifty million man-years have been plowed into Unix development worldwide.1.1969 It is a long time in nearly 35 years in 2003. With the change of the number of historical graphs in the number of UNIX sites, the world is very likely to have a development of 50 million years to develop in UNIX.

2. This Particular Footnote Is Dedicated to Terry Pratcher, Whose Use of Footnotes IS Quite ... Inspiring.

Terry Pratchett contributed to this special footnote, his use of footnote is very encouraging.

3An appreciation of Alexander's work, with links to on-line versions of significant portions, may be found at Some Notes on Christopher Alexander [http://www.math.utsa.edu/sphere/salingar/Chris.text.html].

3. Thank Alexander to some important work on the online connection translation, you can find some notes at this website Christopher Alexander [http://www.math.utris.edu/sphere/salingar/chris.text.html].

4IN FACT, Ethernet Has Already Been Replaced by a Different Technology with The Same Name - Twice. Once When COAX WAS Replaced with Twisted Pair, And A Second Time When GigaBit Ethernet Came IN.

In fact, Ethernet has been used in the same technology to replace twice. The first time COAX was replaced by twisted pair, the second time was when GigaBit intervention.

转载请注明原文地址:https://www.9cbs.com/read-15422.html

New Post(0)