《UNIX编程艺术》摘记

Jolly Wing posted @ 2015年11月08日 21:13 in 技术书摘 with tags book unix linux programming , 1673 阅读

Unix诞生于1969年。

Unix哲学是自下而上的,而不是自上而下的。

unix程序的目标:只做一件事并做好它。编程的核心是数据结构,而不是算法。

unix哲学可以概括为:

  1. 模块原则:使用简洁的接口拼合简单的部件。
  2. 清晰原则:清晰胜于机巧。在写程序时,要想到你不是写给执行代码的计算 机看的,而是给人看的。花哨的代码不利于维护。
  3. 组合原则:设计时考虑拼接组合。在输入输出方面,Unix传统极力提倡采用 简单、文本化、面向流、设备无关的格式。
  4. 分离原则:策略同机制分离,接口同引擎分离。这种模式的经典例子是Emacs 编辑器。它使用内嵌的脚本语言Lisp解释器来控制C编写的编辑原语操作。
  5. 简洁原则:设计要简洁,复杂度能低则低。
  6. 吝啬原则:除非确无它法,不要编写庞大的程序。尽量利用现有的资源。
  7. 透明性原则:设计要可见,以便审查和调试。
  8. 健壮原则:健壮源于透明与简洁。
  9. 表示原则:把知识叠入数据以求逻辑质朴而健壮。 面对复杂数据和复杂代码,宁愿选择前者。 换句话说,使用合适的数据结构,能够简化程序逻辑。
  10. 通俗原则:接口设计避免标新立异
  11. 缄默原则:如果一个程序没什么好说的,就保持沉默
  12. 补救原则:出现异常时,马上退出并给出足量错误信息。
  13. 经济原则:宁花机器一分,不花程序员一秒。
  14. 生成原则:避免手工hack,尽量编写程序去生成程序。
  15. 优化原则:雕琢前先得有原型,跑之前先学会走。 用“极限编程”宗师kent beck的话讲: 先求运行,再求正确,最后求快。
  16. 多样原则:决不相信所谓“不二法门”的断言
  17. 扩展原则:设计着眼未来,未来总比预想快。

unix哲学,一言以蔽之: KISS = Keep It Simple, Stupid!

 
 
Avatar_small
cleaning company in 说:
2019年9月11日 20:46

SpringMaids Generating Cleaning Assistance LLC can be described as professional vacuuming services specialist for at the same time domestic not to mention commercial cleanings through Dubai. Part associated with international Staff with companies inside the uk, We are better established and recognized accompanied by a combined experience of over 15 years in your cleaning market place.

Avatar_small
www.sikkimhealth.org 说:
2019年11月11日 23:30

It consultants handle business clients to better the it department within a organization. Consultants assistance companies during the implementation for new technology during the organization.

Avatar_small
river bank marketing 说:
2020年3月18日 00:38

Online digital Marketing is known as a broad term inclusive of advertising, marketing and advertising, and strengthening press announcements presence in businesses because of digital networks. Some belonging to the digital tips that fall under the umbrella of 'Digital Marketing' can be digital promotional, email selling, content selling, pay-per-click, web based brochures, and a lot more.

Avatar_small
siberyan health 说:
2020年3月18日 00:39

Important and Very important Health Designs - First-class a limited medical insurance coverage benefit within a considerably cheap insurance cost you. In deciding on this specific health policy, it is a good idea that people must read that policy detailed description giving special look at covered expertise. There can be plans which not go over on various basic procedures, certain clinical services which includes chemotherapy, maternal care and certain solutions.

Avatar_small
healthy n balanced 说:
2020年3月18日 00:40

While for a few people, wellness products may just be viewed being a aid to help you recovery as a result of illness, for others perhaps a strategy of further developing some.

Avatar_small
sikkim health 说:
2020年3月18日 00:40

Well-being worries definitely serve an objective and it purpose is simply not difficult to help you detect in cases where one feels deep good enough into it pattern in behavior. Often it pattern involves the mind distracting as a result of specific emotions that the individual realizes difficult to deal with.

Avatar_small
clean tech laws 说:
2020年3月18日 00:41

Try to make personal task your default arranging. Yes, initially it will be easier, cheaper and a lot more convenient accountable, excuse, refuse and/or underestimate responsibility rather than to take it. Such is the current default settings in every cultures, including much of our. In that long if they are not medium wide variety, however, it will be healthier, as pleasing and stronger to assume at a minimum some sum responsibility.

Avatar_small
full time maids in d 说:
2020年4月27日 23:44

Considering and preparing the bridesmaid shower will be major among the list of maid with honor assignments. Seek the assistance of the bride's mother and maybe the groom's mummy too. Never go them alone, for you will possibly not know a finer points. So far as being the event runs, you may possibly plan anything similar to a grand dinner to the cozy cappuccino meet plus anywhere similar to a nearby eatery, a ceremonial platform to even your office garden.

Avatar_small
painting company in 说:
2020年4月27日 23:44

If screening plus talking by using painters, just remember to specify this work plus coverage that must be done for you to get a quotes perfectly. Keep under consideration that a interested trades-people and dwelling painters will need to bid about the same scope with works- with the areas that can be painted to upon color that you like.

Avatar_small
dial a maid dubai 说:
2021年6月06日 01:04

Consequently, get correctly clean premises by only following a number of essential pro advice. Along with, when it relates to getting a new top-rated home cleaning, Maid Firm Dubai contains the best property cleaners to make available you the top bet. In addition, they know the best way to get satisfactory cleanup results quickly.

Avatar_small
Grade 8 Result jesso 说:
2022年8月27日 16:41

Bangladesh Education Board DPE has conducted the class 8th grade of Junior School Certificate Exam and Junior Dakhil Certificate Exam on 1st to 15th November 2022 at all centers in division wise under Ministry of Primary and Mass Education (MOPME), and the class 8th grade terminal examination tests are successfully conducted for all eligible JSC/JDC students for the academic year of 2022. Grade 8 Result jessore The Bangladesh government Minister of Secondary Education is going to announce the JSC Result 2022 in student wise for division students in education board wise, and the result documents will be submitted to the Prime Minister of the country after then the result with mark sheet will be announced to public to check the individual result.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter