Code Reading -chap7
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+ Chapter7: Coding Standards and Conventions
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
137. Knowing the file organization followed by a given code base allows you to browse efficiently
through the source code.(P.22)
若了解跟随一个给定代码库的文件的组织,这将会允许你有效的浏览源代码。
---------------------------------------------------
138. Ensure that the tab setting of your editor or
pretty—printer matches the style guide specifications
of the code you are
reading.(P.228)
确保你的编辑器的tab的设置或者美化打印匹配了你正在阅读的代码的风格指南说明。
---------------------------------------------------
139. Use the indentation indentation of a code block to quickly grasp its overall structure.(P.229)
使用代码块缩排来快速的理解其整个的结构。
---------------------------------------------------
140. Inconsistently formatted code should immediately raise your defenses.(p.231)
不一致格式的代码应当立即引起你的警觉。
---------------------------------------------------
141. Pay special attention to code sequences flagged with XXX,FIXME,and TODO comments:
errors may lurk in them.(P.233)
对以下所述的代码标记保持特殊关注:XXX(译注:?),FIXME,以及TODO 注解;错误很可能千伏在它们之中。
---------------------------------------------------
142. Constants are named by using uppercase characters,with words separated by underscores.(P.234)
常量是用字母全大写的字符命名的,其中的单词以下划线进行分割。
---------------------------------------------------
143. In programs that follow the Java coding conventions,package names always start from a
top—level domain name(for example,org .,com.s u n),class and interface names start with
an uppercase letter,and method and variable names start with a lowercase letter.(P.235)
跟随JAVA编码规范的程序中,包名总是以 顶级域名来开始命名(比如, org .,com.sun),类以及接口名
以大写的字母开始, 方法以及变量名以小写的字母开始。
---------------------------------------------------
144. The Hungarian notation prefix type tags appearing in front of the name of a user-interface control
will help you determine its role.(p.237)
匈牙利注解前缀类型标记显示在用户接口控制的名字之前,将会帮助你决定它的角色。
---------------------------------------------------
145. Different programming standards may have incompatible notions of what constitutes
a portable construct.(p.237)
不同的程序标准可能有不可类比的“什么组成了一个可移植概念”这么一种观念。
---------------------------------------------------
146. When inspecting code for portability and using a given coding standard as a guide,take care to
understand the extent and limits of the standard’s portability requirements.(P.238)
当就可移植性来检查代码的时候,并且使用了一个给定的编码标准作为指南的话,要小心的去理解
标准的可移植性需求的扩展以及其限制。
---------------------------------------------------
147. When GUI functionality is implemented using an appropriate programming construct,the correct
adoption of a given user-interface specification can be trivially verified by code inspection.(p.239)
当GUI 功能被使用一个适当的程序构造所实现的时候,对一给定的用户接口说明的正确采纳就由于
通过代码审查的方式而显得微不足道了。
---------------------------------------------------
148. Learn how a project’s build process is organized and automated to be able to,swiftly read and
comprehend the corresponding build rules.(P.240)
要去学习一个项目的构建过程是如何组织的,以及自动化是如何成为可能的,快速的去读以及理解相应的构建规则。
---------------------------------------------------
149. When examining a system’s release process,you Can often use as a baseline the requirements
of the corresponding distribution format.(P.240)
当检查一个系统的释放过程时,你可以常常使用一个基线作为相应发布格式的需求 。
++++++++++++++++++++++end of chap7+++++++++++++++++++++++++++++++++++