Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 The Zen of Python is not Zen
#1
As a student of Zen, the Zen of Python has always bugged me. Having been ordained as a lay Zen monk today, I thought I would explain. We are all (most?) familiar with the Zen of Python:

import this Wrote: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!

However, I expect far fewer of you are familiar with this classic Zen verse by Sengcan, featured in the second case of the Blue Cliff Record:

Jianzhi Sengcan Wrote:The Perfect Way is only difficult for those who pick and choose;
Do not like, do not dislike; all will then be clear.

But the Zen of Python is pretty much all about picking and choosing: this is better than that over and over again. It denies the equanimity and acceptance that is at the heart of Zen practice. It denies the emptiness of categories that is at the heart of Zen philosophy. So it may be good coding practice, but it is not good Zen.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote
#2
I don't think it was ever intended to be taken literally as valid Zen.
Quote
#3
Then why call it Zen?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote
#4
Chinese Checkers - Invented in Germany
Arabic Numerals - Originated in India
Koala bears - Not bears, but Marsupials
Starfish - Not a fish, it's an echinoderms.
Panama hats - From Ecuador
...
Quote
#5
ichabod801 Wrote:But the Zen of Python is pretty much all about picking and choosing
It is probably a western (and therefore more or less ignorant) view of zen. It's a set of wise maxims that should guide the python programmer in its quest of writing good programs.

I remember reading a small book by Ray Bradbury, the science fiction author, named "Zen in the art of writing". He gives many advices in order to improve one's ability to write. You could perhaps read it and tell us if it has anything to do with zen.
Quote
#6
Likely from a very popular book from back in the 1970's and early 80's: Zen and the art of motorcycle maintenance: http://www.arvindguptatoys.com/arvindgup...rcycle.pdf

After the book was published, a whole rash of Zen and ... items appeared.
Quote
#7
I'm very much impressed. It contains many sections about mathematics and Poincaré. I wonder what this has to do with motorcycles.
Quote
#8
I read the book back in the 1970's, but can't remember much. I do seem to recall someone who travels about, repairing a motorcycle along the way. Philosophy of some sort. I have difficulty remembering where I left my coffee, much less remembering something that I read so long ago.
Quote
#9
One can interpret Zen this way:

Perfect Way:
- do not like
- do not dislike

Python Way:
- Beautiful is better than ugly
...
- Namespaces are one honking great idea -- let's do more of those!

There are rules to be obeyed to follow the Way, both in real Zen and 'Zen of Python'.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Quote
#10
I read Zen and the Art of Motorcycle Maintenance as well. I have a motorcycle, so as a Zen biker people where constantly asking me if I'd read that book. There is some Zen in there, but not a lot, although I did stop reading it part way through. I think he gets Zen right in the sense of the distinction between experience and conscious thought, but then he seems to go overboard in saying that if it's not conscious thought, then it comes from some external absolute. This ignores the possibility of thought that we are not conscious of.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)