Polish style-guild.jade 2

This commit is contained in:
Yang Lin 2016-11-29 21:52:54 +08:00
parent 4ca4a0a9f6
commit 3b13471cb4
1 changed files with 10 additions and 10 deletions

View File

@ -144,7 +144,7 @@ a(id='toc')
:marked :marked
**Do** define one thing (e.g. service or component) per file. **Do** define one thing (e.g. service or component) per file.
**坚持**每个文件只定义一样东西(如服务或组件)。 **坚持**每个文件只定义一样东西(如服务或组件)。
.s-rule.consider .s-rule.consider
:marked :marked
@ -215,7 +215,7 @@ a(href="#toc").to-top 回到顶部
:marked :marked
### <a id="01-02"></a>Small Functions ### <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> #### <a href="#01-02">Style 01-02</a>
@ -225,7 +225,7 @@ a(href="#toc").to-top 回到顶部
:marked :marked
**Do** define small functions **Do** define small functions
**坚持**定义函数 **坚持**定义简单函数
.s-rule.consider .s-rule.consider
:marked :marked
@ -236,31 +236,31 @@ a(href="#toc").to-top 回到顶部
:marked :marked
**Why?** Small functions are easier to test, especially when they do one thing and serve one purpose. **Why?** Small functions are easier to test, especially when they do one thing and serve one purpose.
**为何?**函数更易于测试,特别是当它们只做一件事,只为一个目的服务时。 **为何?**简单函数更易于测试,特别是当它们只做一件事,只为一个目的服务时。
.s-why .s-why
:marked :marked
**Why?** Small functions promote reuse. **Why?** Small functions promote reuse.
**为何?**函数促进代码重用。 **为何?**简单函数促进代码重用。
.s-why .s-why
:marked :marked
**Why?** Small functions are easier to read. **Why?** Small functions are easier to read.
**为何?**函数更易于阅读。 **为何?**简单函数更易于阅读。
.s-why .s-why
:marked :marked
**Why?** Small functions are easier to maintain. **Why?** Small functions are easier to maintain.
**为何?**函数更易于维护。 **为何?**简单函数更易于维护。
.s-why.s-why-last .s-why.s-why-last
:marked :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. **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 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. **Why?** Unabbreviated type names such as `.service` are descriptive and unambiguous.
Abbreviations such as `.srv`, `.svc`, and `.serv` can be confusing. Abbreviations such as `.srv`, `.svc`, and `.serv` can be confusing.
**为何?** `.service`这样的没有简写过的类型名字,描述清楚,毫不含糊。 **为何?** `.service`这样的没有简写过的类型名字,描述清楚,毫不含糊。
像`.srv`, `.svc`, 和 `.serv`这样的简写可能令人困惑。 像`.srv`, `.svc`, 和 `.serv`这样的简写可能令人困惑。
.s-why.s-why-last .s-why.s-why-last
@ -554,7 +554,7 @@ a(href="#toc").to-top 回到顶部
:marked :marked
**Why?** Clear service names such as `Logger` do not require a suffix. **Why?** Clear service names such as `Logger` do not require a suffix.
**为何?**`Logger`这样的清楚的服务名不需要后缀。 **为何?**`Logger`这样的清楚的服务名不需要后缀。
.s-why.s-why-last .s-why.s-why-last
:marked :marked