python之父的coding禅念

情怀,是一个摸不到见不着的东西!码代码砖是不是也应该有自己的情怀,python之父表达了python之禅,这应该也是一种情怀吧!

➜  smslit python
Python 2.7.10 (default, Feb  7 2017, 00:08:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import this
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!

有高人翻译了个三字经,厉害了:

The Zen of Python, 
蛇宗三字经 
 
作者: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! 
每师出,多有名

develop

477 字

2017-06-02 14:39 +0000