Zen of Python, 編程規則的詩與歌曲

來源: 移花接木 2021-08-07 14:11:03 [] [博客] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (2312 bytes)
本文內容已被 [ 移花接木 ] 在 2021-08-07 14:42:26 編輯過。如有問題,請報告版主或論壇管理刪除.

The Zen of Python is a collection of 19 "guiding principles" for writing computer programs that influence the design of the Python programming language. Software engineer Tim Peters wrote this set of principles and posted it on the Python mailing list in 1999. Peters's list left open a 20th principle "for Guido to fill in", referring to Guido van Rossum, the original author of the Python language. The vacancy for a 20th principle has not been filled.

Peters's Zen of Python was included as entry number 20 in the language's official Python Enhancement Proposals and was released into the public domain. It is also included as an Easter egg in the Python interpreter, where it can be displayed by entering import this.

In May 2020, Barry Warsaw wrote the lyrics to music.

 

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.[a]
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.[b]
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!

所有跟帖: 

是啊,計算機語言也是語言,也是歌詞!編曲配器聽著很酷! -beautifulwind- 給 beautifulwind 發送悄悄話 beautifulwind 的博客首頁 (0 bytes) () 08/07/2021 postreply 15:09:55

音樂響起,恍惚間我覺得是楓老師的作品, 這首押韻的編程規則很酷,寫了19條還留下一條等人填上去。 -移花接木- 給 移花接木 發送悄悄話 移花接木 的博客首頁 (0 bytes) () 08/07/2021 postreply 15:22:41

這歌詞寫得太棒了! -欲借嵯峨- 給 欲借嵯峨 發送悄悄話 欲借嵯峨 的博客首頁 (0 bytes) () 08/07/2021 postreply 15:30:20

My favorite “If the implementation is hard to explain, it's a ba -Lily2005- 給 Lily2005 發送悄悄話 Lily2005 的博客首頁 (0 bytes) () 08/07/2021 postreply 18:47:00

這歌酷,確實如此,我一直追求越簡單越好,哈哈! -天山晨- 給 天山晨 發送悄悄話 天山晨 的博客首頁 (0 bytes) () 08/07/2021 postreply 19:19:46

PYTHON = (P)rogrammers (Y)earning (T)o (H)omestead (O)ur (N)oosp -LYJiang- 給 LYJiang 發送悄悄話 LYJiang 的博客首頁 (76 bytes) () 08/07/2021 postreply 20:11:55

IT guy...haha , how about C++? -盈盈一笑間- 給 盈盈一笑間 發送悄悄話 盈盈一笑間 的博客首頁 (0 bytes) () 08/08/2021 postreply 10:23:15

I'm 2 old 2 C# -移花接木- 給 移花接木 發送悄悄話 移花接木 的博客首頁 (0 bytes) () 08/08/2021 postreply 16:18:16

C# will be 2 easy for you. -Lily2005- 給 Lily2005 發送悄悄話 Lily2005 的博客首頁 (0 bytes) () 08/08/2021 postreply 20:21:59

need reading glasses, 老花鏡 -移花接木- 給 移花接木 發送悄悄話 移花接木 的博客首頁 (0 bytes) () 08/08/2021 postreply 20:27:28

Philosophical :) Great! -甜蟲蟲- 給 甜蟲蟲 發送悄悄話 甜蟲蟲 的博客首頁 (0 bytes) () 08/09/2021 postreply 08:35:33

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”