没有合适的资源?快使用搜索试试~ 我知道了~
The Art of Unix Programming
需积分: 0 4 下载量 106 浏览量
2009-04-16
15:40:07
上传
评论
收藏 1.85MB PDF 举报
温馨提示
试读
384页
自认为是一本不错的参考资料,常上来和大家一起分享
资源详情
资源评论
资源推荐
The Art of Unix Programming
Eric Steven Raymond
Thyrsus Enterprises
Copyright © 2003 Eric S. Raymond
Revision History
Revision 0.0 1999 esr
Public HTML draft, first four chapters only.
Revision 0.1 16 November 2002 esr
First DocBook draft, fifteen chapters. Released to Mark Taub at AW.
Revision 0.2 2 January 2003 esr
First manuscript walkthrough at Chapter 7. Released to Dmitry Kirsanov at AW production.
Revision 0.3 22 January 2003 esr
First eighteen-chapter draft. Manuscript walkthrough at Chapter 12. Limited release for early
reviewers.
Revision 0.4 5 February 2003 esr
Release for public review.
Dedication
To Ken Thompson and Dennis Ritchie, because you inspired me.
Table of Contents
Requests for reviewers and copy-editors
Preface
Who Should Read This Book
How To Use This Book
Related References
Conventions Used In This Book
Our Case Studies
Author’s Acknowledgements
I. Context
1. Philosophy
Culture? What culture?
The durability of Unix
The case against learning Unix culture
What Unix gets wrong
What Unix gets right
Open-source software
Cross-platform portability and open standards
The Internet
The open-source community
Flexibility in depth
Unix is fun to hack
The lessons of Unix can be applied elsewhere
Basics of the Unix philosophy
Rule of Modularity: Write simple parts connected by clean interfaces.
Rule of Composition: Design programs to be connected with other programs.
Rule of Clarity: Clarity is better than cleverness.
Rule of Simplicity: Design for simplicity; add complexity only where you must.
Rule of Transparency: Design for visibility to make inspection and debugging easier.
Rule of Robustness: Robustness is the child of transparency and simplicity.
Rule of Least Surprise: In interface design, always do the least surprising thing.
Rule of Repair: Repair what you can — but when you must fail, fail noisily and as soon
as possible.
Rule of Economy: Programmer time is expensive; conserve it in preference to machine
time.
Rule of Generation: Avoid hand-hacking; write programs to write programs when you
can.
Rule of Representation: Use smart data so program logic can be stupid and robust.
Rule of Separation: Separate policy from mechanism; separate interfaces from engines.
Rule of Optimization: Prototype before polishing. Get it working before you optimize
it.
Rule of Diversity: Distrust all claims for one true way.
Rule of Extensibility: Design for the future, because it will be here sooner than you
think.
The Unix philosophy in one lesson
Applying the Unix philosophy
Attitude matters too
2. History
Origins and history of Unix, 1969-1995
Genesis: 1969-1971
Exodus: 1971-1980
TCP/IP and the Unix Wars: 1980-1990
Blows against the empire: 1991-1995
Origins and history of the hackers, 1961-1995
At play in the groves of academe: 1961-1980
Internet fusion and the Free Software Movement: 1981-1991
Linux and the pragmatist reaction: 1991-1998
The open-source movement: 1998 and onward.
The lessons of Unix history
3. Contrasts
The elements of operating-system style
What is the unifying idea?
Cooperating processes
Internal boundaries
File attributes and record structures
Binary file formats
Preferred UI style
Who is the intended audience?
What are the entry barriers to development?
Operating-system comparisons
VMS
Mac OS
OS/2
Windows NT
BeOS
Linux
What goes around, comes around
II. Design
4. Modularity
Encapsulation and optimal module size
Compactness and orthogonality
Compactness
Orthogonality
The DRY rule
The value of detachment
Top-down, bottom-up, and glue layers
Case study: C considered as thin glue
Library layering
Case study: GIMP plugins
Unix and object-oriented languages
Coding for modularity
5. Textuality
The Importance of Being Textual
Case study: Unix password file format
Case study: .newsrc format
Case study: The PNG graphics file format
Data file metaformats
/etc/passwd style
RFC-822 format
Fortune-cookie format
XML
Windows INI format
Unix textual file format conventions
Application protocol design
Case study: SMTP, a simple socket protocol
Case study: POP3, the Post Office Protocol
Case study: IMAP, the Internet Message Access Protocol
Application protocol metaformats
The classical Internet application metaprotocol
HTTP as a universal application protocol
BEEP
XML-RPC. SOAP, and Jabber
Binary files as caches
6. Multiprogramming
Separating complexity control from performance tuning
Handing off tasks to specialist programs
Case study: the mutt mail user agent.
Pipes, redirection, and filters
Case study: Piping to a Pager
Case study: making word lists
Case study: pic2graph
Case study: bc(1) and dc(1)
Slave processes
Case study: scp(1) and ssh
Wrappers
Case study: backup scripts
Security wrappers and Bernstein chaining
Peer-to-peer inter-process communication
Signals
System daemons and conventional signals
Case study: fetchmail’s use of signals
Temp files
Shared memory via mmap
Sockets
Obsolescent Unix IPC methods
Client-Server Partitioning for Complexity Control
Case study: PostgreSQL
Case study: Freeciv
Two traps to avoid
Remote procedure calls
Threads — threat or menace?
A fearful synergy
7. Transparency
Some case studies
Case study: audacity
Case study: fetchmail’s -v option
Case study: kmail
Case study: sng
Case study: the terminfo database
Case study: Freeciv data files
Designing for transparency and discoverability
The Zen of transparency
Coding for transparency and discoverability.
Transparency and avoiding overprotectiveness.
Transparency and editable representations.
Transparency, fault diagnosis, and fault recovery
Designing for maintainability
8. Minilanguages
Taxonomy of languages
Applying minilanguages
Case study: sng
Case study: Glade
Case study: m4
Case study: XSLT
Case study: the DWB tools
Case study: fetchmailrc
Case study: awk
Case study: Postscript
Case study: bc and dc
Case study: Emacs Lisp
Case study: JavaScript
Designing minilanguages
Choosing the right complexity level
Extended and embedded languages
When you need a custom grammar
Macros — beware!
Language or application protocol?
9. Generation
Data-driven programming
Regular expressions
Case Study: ascii
Case Study: metaclass hacking in fetchmailconf
Ad-hoc code generation
Case study: generating code for a fixed screen display
Case study: generating HTML code for a tabular list
Special-purpose code generators
Yacc and Lex
Glade
Avoiding traps
10. Configuration
Run-control files
Case study: The .netrc file
Portability to other operating systems
Environment variables
Portability to other operating systems
Command-line options
The a to z of command-line options
Portability to other operating systems
How to choose among configuration-setting methods
Case study: fetchmail
Case study: the XFree86 server
On breaking these rules
11. Interfaces
Applying the Rule of Least Surprise
剩余383页未读,继续阅读
CoolChina
- 粉丝: 1
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于ATLAB + Psychtoolbox 心理学实验,情绪词汇效价判断
- 美赛数学建模算法-使用Matlab实现神经网络NeuralNetwork-包括BP+LVQ-国赛-题解.zip
- hb-mapper-makertbin.log
- dfcf_silence_upgrade_cfw_10.15.3_20240318163518_64.apk
- 美赛数学建模算法-使用Matlab实现多元分析MultivariteAnalysis-包括聚类分析+主成分分析-国赛-题解
- 构成学1.psd
- 美赛数学建模算法-使用Matlab实现线性规划LinearProgramming-国赛-题解.zip
- npp-7.2.2-Installer-语言修改器
- FY4B AGRI先进的静止轨道辐射成像仪波段响应函数
- 学习Demo影视推荐、音乐播放、地图
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0