编程原则(中英文对照)

来源:互联网 发布:mac版ie内核浏览器 编辑:程序博客网 时间:2024/04/28 18:24

大笑微笑生气吐舌头吐舌头吐舌头吐舌头吐舌头吐舌头吐舌头吐舌头吐舌头吐舌头吐舌头生气微笑大笑


偷笑我爱北京天安门偷笑


偷笑天安门上太阳升偷笑


偷笑伟大领袖毛主席偷笑


偷笑指引我们向前进偷笑

偷笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑大笑偷笑

设计过程<BR>1 编程的本质是:没有意外,最小化耦合,最大化内聚<BR>2 根除复杂性这个恶魔(Part 1)<BR>2.1 不要解决不存在的问题<BR>2.2 解决一个问题,而不要解决一类问题<BR>3 A user interface should not look like a computer program (the transparency principle)<BR>3 用户接口看起来不应该象一个计算机程序(透明原则)<BR>4 Don't confuse ease of learning with ease of use<BR>4 不要混淆易于使用和易于掌握这两个概念<BR>5 Productivity can be measured in the number of keystrokes<BR>5 生产率可以通过击键次数来衡量<BR>6 If you can't say it in English, you can't say it in C/C++<BR>6 如果你不能用自然语言表达,也就不能用C/C++表达<BR>6.1 Do the comments first<BR>6.1 先写注释<BR>7 Read code<BR>7 阅读代码<BR>7.1 There's no room for prima donnas in a contemporary programming shop<BR>8 Decompose complex problems into smaller tasks<BR>8 将复杂的问题分解为多个小任务<BR>9 Use the whole language (Use the appropriate tool for the job)<BR>10 A problem must be thought through before it can be solved<BR>10 解决问题之前应该深思熟虑<BR>11 Computer programming is a service industry<BR>11 计算机编程是服务行业<BR>12 Involve users in the development process<BR>12 开发过程应该有用户参与<BR>13 The customer is always right<BR>13 客户永远是正确的<BR>14 Small is Beautiful. (Big == slow)<BR>14 小即是美(大==慢)<BR>一般开发问题<BR>15 First, do no harm<BR>15 第一,不要有害<BR>16 Edit your code<BR>16 编辑你的代码<BR>17 A program must be written at least twice<BR>17 一个程序应该至少写两次<BR>18 You can't measure productivity by volume<BR>18 不能用代码量衡量生产率<BR>19 You can't program in isolation<BR>19 编程不能与世隔绝<BR>20 Goof off<BR>20 别把编程太当回事<BR>21 Write code with maintenance in mind梩he maintenance programmer is you<BR>21 写代码的时候应该时刻想着维护,假设你自己就是维护者<BR>21.1 Efficiency is often a bugaboo<BR>21.1 追求效率往往导致其它问题<BR>格式化和文档<BR>22 Uncommented code has no value<BR>22 没有注释的代码没有价值<BR>23 Put the code and the documentation in the same place<BR>23 将代码和文档放在一起<BR>24 Comments should be sentences<BR>24 注释应该是完整的句子<BR>25 Run your code through a spelling checker<BR>25 你的代码应该能通过拼写检查<BR>26 A comment shouldn't restate the obvious<BR>26 不要注释显而易见的东西<BR>27 A comment should provide only information needed for maintenance<BR>27 注释中应该只提供对维护有帮助的内容<BR>28 Comments should be in blocks<BR>28 使用块注释<BR>29 Comments should align vertically<BR>29 注释应该垂直对齐<BR>30 Use neat columns as much as possible<BR>30 代码应该尽可能的整齐的分列<BR>31 Don't put comments between the function name and the open brace<BR>31 不要在函数名和第一个花括号之间写注释<BR>32 Mark the ends of long compound statements with something reasonable<BR>32 在较长的代码块之后做标记性注释<BR>33 Put only one statement per line<BR>33 每行只写一条语句<BR>34 Put argument names in function prototypes<BR>34 函数原型中应该写上参数名<BR>35 Use a 損redicate?form to split up long expressions<BR>36 A subroutine should fit on a screen<BR>36 一个子函数的长度应该在一屏以内<BR>37 All code should be printable<BR>37 所有的代码都应该是可打印的<BR>38 Use lines of dashes for visual separation between subroutines<BR>38 使用整行连字符来隔离子函数代码<BR>39 White space is one of the most effective comments<BR>39 空白是最好的注释之一<BR>40 Use four-space indents<BR>40 使用四个空格做缩进<BR>41 Indent statements associated with a flow-control statement<BR>41 缩进所有与一个流程控制语句相关的语句<BR>41.1.Comments should be at the same indent level as the surrounding code<BR>41.1 注释应该与其对应的代码一同缩进<BR>42 Align braces vertically at the outer level<BR>42 在外层垂直对齐花括号<BR>43 Use braces when more than one line is present under a flow-control statement<BR>43 在流程控制语句下面如果有多于一条的语句,应该使用花括号<BR>
原创粉丝点击