Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1655082
  • 博文数量: 230
  • 博客积分: 10045
  • 博客等级: 上将
  • 技术积分: 3357
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-30 20:40
文章分类

全部博文(230)

文章存档

2011年(7)

2010年(35)

2009年(62)

2008年(126)

我的朋友

分类:

2008-08-28 12:20:57

MacLennan's Language Principles

  1. Abstraction: Avoid requiring something to be stated more than once; factor out the recurring pattern.

  2. Automation: Automate mechanical, tedious, or error-prone activities.

  3. Defense in Depth: Have a series of defenses so that if an error isn't caught by one, it will probably be caught by another.

  4. Information Hiding: The language should permit modules designed so that (1) the user has all of the information needed to use the module correctly, and nothing more; (2) the implementor has all of the information needed to implement the module correctly, and nothing more.

  5. Labeling: Avoid arbitrary sequences more than a few items long; do not require the user to know the absolute position of an item in a list. Instead, associate a meaningful label with each item and allow the items to occur in any order.

  6. Localized Cost: Users should only pay for what they use; avoid distributed costs.

  7. Manifest interface: All interfaces should be apparent (manifest) in the syntax.

  8. Orthogonality: Independent functions should be controlled by independent mechanisms.

  9. Portability: Avoid features or facilities that are dependent on a particular machine or a small class of machines.

  10. Preservation of Information: The language should allow the representation of information that the user might know and that the compiler might need.

  11. Regularity: Regular rules, without exceptions are easier to learn, use, describe, and implement.

  12. Security: No program that violates the definition of the language, or its own intended structure, shoud escape detection.

  13. Simplicity: A language shoud be as simple as possible. There should be a minimum number of concepts with simple rules for their composition.

  14. Structure: The static structrue of the program should correspond in a simple way with the dynamic structure of the corresponding computations.

  15. Syntactic Consistency: Similar things should look similar; different things should look different.

  16. Zero-One-Infinity: The only reasonable numbers are zero, one, and infinity.

Source: MacLennan, Principles of Programming Languages, Holt, Rinehart, and Winston, 1987
阅读(2151) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~