“Explicit is better than implicit” 是 The Zen of Python 中的一句格言。长久以来都觉得挺在理,直到有天有人用这句话为基础,提出了一个我不甚赞同的观点,才发现从来就没有真正理解过它。 神奇的是在搜索过程中,发现讨论这句格言的并没有多少,不同的讨论中对 "explicit" 含义的理解差别也很大,最终发现最...
而最能直观反映Python设计哲学思想的,应该是Python中的一个小彩蛋。我们只需要在编译器中输入:import this 然后运行,你会发现由Tim Peters所总结的“Python之禅“。全文如下:The Zen of Python, by Tim Peters Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Com...
#!/usr/bin/env python import thisPython之禅: 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 …
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 ...
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. ...
“Explicit is better than implicit” 是 The Zen of Python 中的一句格言。长久以来都觉得挺在理,直到有天有人用这句话为基础,提出了一个我不甚赞同的观点,才发现从来就没有真正理解过它。 神奇的是在搜索过程中,发现讨论这句格言的并没有多少,不同的讨论中对 "explicit" 含义的理解差别也很大,最终发现最...
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 ...
Explicit is better than implicit. 明了胜于晦涩(优美的代码应当是明了的,命名规范,风格相似) Simple is better than complex. 简洁胜于复杂(优美的代码应当是简洁的,不要有复杂的内部实现) Complex is better than complicated. 复杂胜于凌乱(如果复杂不可避免,那代码间也不能有难懂的关系,要保持接口简洁) ...
import thisThe Zen ofPython, 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 cas...
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 tobreakthe rules.Although practicality beats purity.Errors should...