21 Laws of Computer Programming (软件编程21法则 )

As any experienced computer programmer knows, there are unwritten laws that govern software development. However there are no penalties for breaking these laws; rather, there is often a reward. Following are 21 Laws of Computer Programming:

任何一个有经验的程序员都知道,软件开发遵循着一些不成文的法则。然而,如果你不遵循这些法则也并不意味着会受到惩罚;相反,有时你还会获得意外的好处。下面的就是软件编程中的21条法则:


1. Any given program, once deployed, is already obsolete.
任何程序一旦部署即显陈旧。

2. It is easier to change the specification to fit the program than vice versa.
修改需求规范来适应程序比反过来做更容易。

3. If a program is useful, it will have to be changed.
一个程序如果很有用,那它注定要被改掉。

4. If a program is useless, it will have to be documented.
一个程序如果没用,那它一定会有很好的文档。

5. Only ten percent of the code in any given program will ever execute.
任何程序里都仅仅只有10%的代码会被执行到。

6. Software expands to consume all available resources.
软件会一直膨胀到耗尽所有资源为止。

7. Any non-trivial program contains at least one error.
任何一个有点价值的程序里都会有至少一个bug。

8. The probability of a flawless demo is inversely proportional to the number of people watching, raised to the power of the amount of money involved.
原型完美的程度跟审视的人数成反比,反比值会随着涉及的资金数增大。

9. Not until a program has been in production for at least six months will its most harmful error be discovered.
软件直到被变成产品运行至少6个月后,它最严重的问题才会被发现。

10. Undetectable errors are infinite in variety, in contrast to detectable errors, which by definition are limited.
无法检测到的错误的形式无限多样,而能被检测到的正好相反,被定义了的十分有限。

11. The effort required to correct an error increases exponentially with time.
修复一个错误所需要投入的努力会随着时间成指数级增加。

12. Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.
软件的复杂度会一直增加,直到超出维护这个程序的人的承受能力。

13. Any code of your own that you haven’t looked at in months might as well have been written by someone else.
任何自己的程序,几个月不看,形同其他人写的。

14. Inside every small program is a large program struggling to get out.
任何一个小程序里面都有一个巨大的程序蠢蠢欲出。

15. The sooner you start coding a program, the longer it will take.
编码开始的越早,花费的时间越长。

16. A carelessly planned project takes three times longer to complete than expected; a carefully planned project takes only twice as long.
一个粗心的项目计划会让你多花3倍的时间去完成;一个细心的项目计划只会让你多花2倍的时间。

17. Adding programmers to a late project makes it later.
往大型项目里添加人手会使项目更延迟。

18. A program is never less than 90% complete, and never more than 95% complete.
一个程序至少会完成90%,但永远完成不了超过95%。

19. If you automate a mess, you get an automated mess.
如果你想麻烦被自动处理掉,你得到的是自动产生的麻烦。

20. Build a program that even a fool can use, and only a fool will want to use it.
开发一个傻瓜都会使用的软件,只有傻瓜愿意使用它。

21. Users truly don’t know what they want in a program until they use it.
用户不会真正的知道要在软件里做些什么,除非使用过。


参考:
[1] http://www.devtopics.com/21-laws-of-computer-programming
[2] http://www.aqee.net/2010/09/30/21-laws-of-computer-programming

posted @ 2010-10-25 19:51  gansc23  Views(221)  Comments(0Edit  收藏  举报