官术网_书友最值得收藏!

1.2 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.(雖然這種方式開始時并不容易,除非你是Python之父)

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!(命名空間就是一個絕妙的想法,應當多加利用)

主站蜘蛛池模板: 砚山县| 米易县| 贡嘎县| 小金县| 五家渠市| 棋牌| 中方县| 石首市| 镇原县| 英吉沙县| 清丰县| 清新县| 宁河县| 壶关县| 长兴县| 阿拉善左旗| 潞西市| 威宁| 孝义市| 林西县| 石狮市| 军事| 敦煌市| 雅江县| 建宁县| 广灵县| 凤山市| 古蔺县| 无锡市| 进贤县| 宕昌县| 绥宁县| 延寿县| 广南县| 辽源市| 嵊州市| 洞口县| 哈巴河县| 宁陵县| 贵南县| 新兴县|