logoalt Hacker News

w-m • today at 9:42 AM • 7 replies • view on HN

  $ python -c "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!

Replies

Waterluvian • today at 6:17 PM

I discovered this early on in my programming journey and it helped set my philosophical trajectory. Over the years I’ve slowly grokked these items. But it was valuable to have a North Star even before I realized why they were important.

shiandow • today at 7:11 PM

The PEP explicitly says there are 20 of which only 19 are written down and I can't figure out if that is a joke, a deliberate statement, or both.

➕ show 1 reply
bitter_michael • today at 7:10 PM

Interestingly, today this text reads not only as good advice for coders but also as good instructions for agents. Perhaps time to revisit those and make sure the spirit of these adages is captured there

gavmor • today at 6:43 PM

I have cited this poem countless times over the years--sometimes ironically. I'm sad.

glerk • today at 7:07 PM

Hard to disagree with any of this. RIP.

svilen_dobrev • today at 6:34 PM

Thank you, Tim Peters.

.

sillysaurusrex • today at 7:20 PM

[dead]