Polish style-guild.jade 2
This commit is contained in:
parent
4ca4a0a9f6
commit
3b13471cb4
|
@ -144,7 +144,7 @@ a(id='toc')
|
|||
:marked
|
||||
**Do** define one thing (e.g. service or component) per file.
|
||||
|
||||
**坚持**每个文件只定义一样东西(如服务或组件)。
|
||||
**坚持**每个文件只定义一样东西(例如服务或组件)。
|
||||
|
||||
.s-rule.consider
|
||||
:marked
|
||||
|
@ -215,7 +215,7 @@ a(href="#toc").to-top 回到顶部
|
|||
:marked
|
||||
### <a id="01-02"></a>Small Functions
|
||||
|
||||
### <a id="01-02"></a>小函数
|
||||
### <a id="01-02"></a>简单函数
|
||||
|
||||
#### <a href="#01-02">Style 01-02</a>
|
||||
|
||||
|
@ -225,7 +225,7 @@ a(href="#toc").to-top 回到顶部
|
|||
:marked
|
||||
**Do** define small functions
|
||||
|
||||
**坚持**定义小函数
|
||||
**坚持**定义简单函数
|
||||
|
||||
.s-rule.consider
|
||||
:marked
|
||||
|
@ -236,31 +236,31 @@ a(href="#toc").to-top 回到顶部
|
|||
:marked
|
||||
**Why?** Small functions are easier to test, especially when they do one thing and serve one purpose.
|
||||
|
||||
**为何?**小函数更易于测试,特别是当它们只做一件事,只为一个目的服务时。
|
||||
**为何?**简单函数更易于测试,特别是当它们只做一件事,只为一个目的服务时。
|
||||
|
||||
.s-why
|
||||
:marked
|
||||
**Why?** Small functions promote reuse.
|
||||
|
||||
**为何?**小函数促进代码重用。
|
||||
**为何?**简单函数促进代码重用。
|
||||
|
||||
.s-why
|
||||
:marked
|
||||
**Why?** Small functions are easier to read.
|
||||
|
||||
**为何?**小函数更易于阅读。
|
||||
**为何?**简单函数更易于阅读。
|
||||
|
||||
.s-why
|
||||
:marked
|
||||
**Why?** Small functions are easier to maintain.
|
||||
|
||||
**为何?**小函数更易于维护。
|
||||
**为何?**简单函数更易于维护。
|
||||
|
||||
.s-why.s-why-last
|
||||
:marked
|
||||
**Why?** Small functions help avoid hidden bugs that come with large functions that share variables with external scope, create unwanted closures, or unwanted coupling with dependencies.
|
||||
|
||||
**为何?**小函数可避免易在大函数中产生的隐蔽性错误,如与外界共享变量、创建意外的闭包或与依赖之间产生意外耦合等。
|
||||
**为何?**简单函数可避免易在大函数中产生的隐蔽性错误,如与外界共享变量、创建意外的闭包或与依赖之间产生意外耦合等。
|
||||
|
||||
a(href="#toc").to-top Back to top
|
||||
|
||||
|
@ -375,7 +375,7 @@ a(href="#toc").to-top 回到顶部
|
|||
**Why?** Unabbreviated type names such as `.service` are descriptive and unambiguous.
|
||||
Abbreviations such as `.srv`, `.svc`, and `.serv` can be confusing.
|
||||
|
||||
**为何?** 象`.service`这样的没有简写过的类型名字,描述清楚,毫不含糊。
|
||||
**为何?** 像`.service`这样的没有简写过的类型名字,描述清楚,毫不含糊。
|
||||
像`.srv`, `.svc`, 和 `.serv`这样的简写可能令人困惑。
|
||||
|
||||
.s-why.s-why-last
|
||||
|
@ -554,7 +554,7 @@ a(href="#toc").to-top 回到顶部
|
|||
:marked
|
||||
**Why?** Clear service names such as `Logger` do not require a suffix.
|
||||
|
||||
**为何?**象`Logger`这样的清楚的服务名不需要后缀。
|
||||
**为何?**像`Logger`这样的清楚的服务名不需要后缀。
|
||||
|
||||
.s-why.s-why-last
|
||||
:marked
|
||||
|
|
Loading…
Reference in New Issue