UNIX哲学

“UNIX哲学”的根本原则:
KISS(Keep it simple, stupid)
保持简单和笨拙。


“UNIX的特点”:
Everything (including hardware) is a file
所有的事物(甚至硬件本身)都是一个的文件。


Configuration data stored in text
以文本形式储存配置数据。


Small, single-purpose program
程序尽量朝向小而单一的目标设计


Avoid captive user interfaces
尽量避免令人困惑的用户接口


Ability to chain program together to perform complex tasks
将几个程序连结起来,处理大而复杂的工作。




----->Doug McIlroy
Write programs that do one thing and do it well。
编写只做一件事情,并且要做好的程序。


Write programs to work together。
编写可以在一起工作的程序。


Write programs to handle text streams, because that is a universal interface。
编写处理文本流的程序,因为这是通用的接口。


《The Art of Unix Programming》
1)Rule of Modularity: Write simple parts connected by clean interfaces。
模块化原则:编写简单的组件,用整齐的接口让它们互联。


2)Rule of Clarity: Clarity is better than cleverness。
清晰性原则:清晰要比灵巧重要。


3)Rule of Composition: Design programs to be connected to other programs。
整合化原则: 新设计的程序要考虑和其它程序共同工作。


4)Rule of Separation: Separate policy from mechanism; separate interfaces from engines。
分离性原则: 让机制与策略分离;让接口同引擎分离。


5)Rule of Simplicity: Design for simplicity; add complexity only where you must。
简单化原则: 为了简单而设计;只在你确信必要的地方增加复杂度。


6)Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do。
吝啬性原则: 只有被证明了其它东西无法完成工作时才编写“大”程序。


7)Rule of Transparency: Design for visibility to make inspection and debugging easier。
透明化原则: 设计一个高度可见的程序可以使检查及调试更容易。


8)Rule of Robustness: Robustness is the child of transparency and simplicity。
健壮性原则: 健壮性是透明化以及简单化的产物。


9)Rule of Representation: Fold knowledge into data so program logic can be stupid and robust。
表示原则:把知识叠入数据以求逻辑质朴而健壮。


10)Rule of Least Surprise: In interface design, always do the least surprising thing。
最小立异化原则: 在接口设计方面,一定不要总想标新立异。


11)Rule of Silence: When a program has nothing surprising to say, it should say nothing。
安静性原则: 当一个程序没有什么值得炫耀时,就不要炫耀。


12)Rule of Repair: When you must fail, fail noisily and as soon as possible。
修复原则: 是的,一旦当你不得不面对失败时,失败就会变得愈发喧闹。


13)Rule of Economy: Programmer time is expensive; conserve it in preference to machine time。
经济性原则: 程序员的时间是宝贵的,把它让度于机器时间。


14)Rule of Generation: Avoid hand-hacking; write programs to write programs when you can。
生产化原则: 避免手工hacking操作;尽可能让程序完成编程工作


15)Rule of Optimization: Prototype before polishing。 Get it working before you optimize it。
优化性原则: 先做模具再打磨润色;先让程序工作,然后优化它。


16)Rule of Diversity: Distrust all claims for “one true way”。
多样化原则: 千万不要信赖包治百病的药。


17)Rule of Extensibility: Design for the future, because it will be here sooner than you think。
扩展性原则: 多为将来考虑,因为它会比你预料更快地来到现实。




“其它经典名言”:
Make it run, then make it right, then make it fast.
先求运行,再求正确,最后求快。




“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。”



只有痴迷的“黑客”和具有创造力的怪人结成的反叛联盟才能把我们从愚蠢中拯救出来——他们接着教导我们,真正的专业和奉献精神,正是我们在屈服于世俗观念的“合理商业做法”之前的所作所为。


过度依赖任何一种技术或者商业模式都是错误的——相反,保持软件及其设计传统的的灵活性才是长存之道。



Small is beautiful。


Make each program do one thing well。


Build a prototype as soon as possible。


Choose portability over efficiency。


Store data in flat text files。


Use software leverage to your advantage。


Use shell scripts to increase leverage and portability。


Avoid captive user interfaces。


Make every program a filter。




“相关书籍”:
《Linus Torvalds 语录 Top 10》
《谁写了Linux》
《Linux基金会的广告》
《Linux Distribution Timeline》
《C语言的演变史》
《Unix 40年:Unix年鉴》
《Unix 40年:昨天,今天和明天》


《到处都是Unix的胎记》

http://en。wikipedia。org/wiki/Unix_philosophy


《The Unix-Haters Handbook》,中文译做《Unix痛恨者手册》

http://research.microsoft.com/~daniel/uhh-download.html.







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值