- Python語言及其應用(第2版)
- (美)比爾·盧巴諾維奇
- 283字
- 2022-04-15 17:15:41
1.11 禪意時刻
每種計算機語言都有自己的風格。我在前言中提到過,可以使用Python化的方式來表達自我。Python中內置了一些自由體詩歌,簡單明了地傳遞了Python的哲學(據我所知,Python是唯一一種包含這種彩蛋程序的語言)。只要在交互式解釋器中輸入import this,然后按下回車鍵就能看到如下內容:
>>> 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!
我會將這些哲學貫穿全書。
推薦閱讀
- FuelPHP Application Development Blueprints
- 精通JavaScript+jQuery:100%動態網頁設計密碼
- Visual Basic程序開發(學習筆記)
- Hands-On Data Structures and Algorithms with JavaScript
- Mastering Google App Engine
- Python:Master the Art of Design Patterns
- Oracle JDeveloper 11gR2 Cookbook
- Learning Apache Mahout Classification
- 數據結構案例教程(C/C++版)
- SpringBoot從零開始學(視頻教學版)
- ActionScript 3.0從入門到精通(視頻實戰版)
- Learning Ionic
- Web前端開發技術:HTML、CSS、JavaScript
- Web開發的平民英雄:PHP+MySQL
- C語言程序設計教程