- 优雅才是王道
Beautiful is better than ugly.
编程是要解决问题的,设计良好、高效而漂亮的解决方案都会让程序员心生敬意。
- 明了胜过晦涩
Explicit is better than implicit.
- 化繁为简
Simple is better than complex.
- 复杂胜过纠结
Complex is better than complicated.
- 减少嵌套
Flat is better than nested.
- 稀疏优于稠密
Sparse is better than dense.
- 选择最简单可读的方案
Readability counts.
- 尽管实用优于纯粹,但规则也比特例重要
Special cases aren't special enough to break the rules.
Although practicality beats purity.
- 除非明确地知道原因,否则不要放过任何错误
Errors should never pass silently.
Unless explicitly silenced.
- 面对歧义,拒绝猜测,弄清楚它。
In the face of ambiguity, refuse the temptation to guess.
- 显而易见的做法应该有且仅有一个,尽管它刚开始可能不是那么显而易见,毕竟我们不是那个荷兰人(Python 之父)。
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
- 尽管 “决不” 常常优于 “马上”,但是 “现在” 往往优于 “决不”。
Now is better than never.
Although never is often better than *right* now.
- 如果实现很难解释清楚,就说明这不是一个好主意。
If the implementation is hard to explain, it's a bad idea.
- 如果实现很容易解释清楚,仅仅说明这可能是一个好主意。
If the implementation is easy to explain, it may be a good idea.
- 命名空间是个好东西 —— 放手去用吧!
Namespaces are one honking great idea -- let's do more of those!
网友评论