Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5aa8732

Browse files
committed
fix: typos
1 parentd691f2d commit5aa8732

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

‎README.md‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
软件工程需要遵守的一些原则。参考了 Robert C. Martin's 的
2121
[*代码整洁之道*](https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882),原书编程语言使用的是用 javascript,这里将它改写提炼成了 python 版本。核心思想是一样的。这并不是一个介绍 python 代码风格的手册。它的核心目的是帮助大家用 python 写出:可读性高,易用,易于重构的项目。
2222

23-
这里介绍的原则并不需要严格每一条都严格执行,也许有些人只会赞同里面的一部分。但是这些原则都是*代码整洁之道*作者多年经验的总结。
23+
这里介绍的原则并不需要每一条都严格执行,也许有些人只会赞同里面的一部分。但是这些原则都是*代码整洁之道*作者多年经验的总结。
2424

25-
请注意里面的示例代码只能在 Python3.7 及以上的版本运行。
25+
请注意这里的示例代码只能在 Python3.7 及以上的版本运行。
2626

2727
##**变量**
2828

@@ -49,8 +49,7 @@ current_date: str = datetime.date.today().strftime("%y-%m-%d")
4949

5050
**[⬆ 回到顶部](#目录)**
5151

52-
同一个项目中,表示同一个东西的时候请使用相同的变量名。
53-
###Use the same vocabulary for the same type of variable
52+
###同一个项目中,表示同一个东西的时候请使用相同的变量名
5453

5554
**不好的例子:**
5655
这里我们用了三个不同的变量名(user,client,customer)表示了同一个东西:
@@ -137,8 +136,7 @@ if matches:
137136

138137
**改进1**:
139138

140-
这个比上面那个例子好一些,但是仍然强依赖正则表达式
141-
It's better, but we are still heavily dependent on regex.
139+
这个比上面那个例子好一些,但是仍然强依赖正则表达式。
142140

143141
```python
144142
import re
@@ -170,10 +168,8 @@ if matches:
170168
```
171169
**[⬆ 回到顶部](#目录)**
172170

173-
###Avoid Mental Mapping
171+
###起名不要想当然
174172
不要让阅读你代码的人猜变量名表示的含义,直接显式的在变量名中表示它想表达的东西。
175-
Don’t force the reader of your code to translate what the variable means.
176-
Explicit is better than implicit.
177173

178174
**不好的例子:**
179175

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp