Python的禅,“提姆彼得斯”说的非常有道理道出了这门编程语言的真谛!
2016-03-25 13:22
525 查看
The Zen of Python, by Tim Peters
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.
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!
Python的禅,由提姆彼得斯
美丽比丑陋好。
外显胜于内隐。
简单比复杂。
复杂的是比复杂的。
平比嵌套好。
稀疏比致密。
可读性计数。
特殊情况下是不够的,打破规则。
虽然实用性节拍纯度。
错误永远不会通过无声。
除非显式地沉默。
面对模糊,拒绝猜测的诱惑。
应该有一个-最好只有一个-明显的方式去做。
虽然这种方式可能不明显,除非你是荷兰人。
现在比从来没有。
虽然从来没有比现在更好。
如果实施是很难解释的,这是个坏主意。
如果实施容易解释,这可能是一个好主意。
名称空间是一个伟大的想法-让我们做更多的!
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.
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!
Python的禅,由提姆彼得斯
美丽比丑陋好。
外显胜于内隐。
简单比复杂。
复杂的是比复杂的。
平比嵌套好。
稀疏比致密。
可读性计数。
特殊情况下是不够的,打破规则。
虽然实用性节拍纯度。
错误永远不会通过无声。
除非显式地沉默。
面对模糊,拒绝猜测的诱惑。
应该有一个-最好只有一个-明显的方式去做。
虽然这种方式可能不明显,除非你是荷兰人。
现在比从来没有。
虽然从来没有比现在更好。
如果实施是很难解释的,这是个坏主意。
如果实施容易解释,这可能是一个好主意。
名称空间是一个伟大的想法-让我们做更多的!
相关文章推荐
- Python学习笔记(三)Python的list和tuple
- python 静态成员变量
- python函数——编码问题——str与Unicode的区别
- 01python初识—编辑器&版本&变量知识
- Python学习笔记(四)Python函数的参数
- Python关键字总结
- 通过抓包获取跳转url并通过dnspython模块查询监控服务是否正常
- Python学习:Flask框架和jinja2模板
- bat调用python命令
- numpy.zeros(shape, dtype=float, order='C')
- numpy.ones(shape, dtype=None, order='C')
- Python 正则表达式的剖析
- python3安装Fabric模块
- python glob使用
- leetcode @python 120. Triangle
- 重装python idle打不开解决方案
- leetcode @python 119. Pascal's Triangle II
- python2.7:str unicode 详解
- leetcode @python 118. Pascal's Triangle
- 【转】python - PyDev统一编码