Is Python a Zen language?

J

John Coleman

Greetings,
I have a rough classification of languages into 2 classes: Zen
languages and tool languages. A tool language is a language that is,
well, a *tool* for programming a computer. C is the prototypical tool
language. Most languages in the Algol family are tool languages. Visual
Basic and Java are also tool languages. On the other hand, a Zen
language is a language which is purported to transform your way of
thinking about programming. Lisp, Scheme, Forth, Smalltalk and (maybe)
C++ are Zen languages. Disciples acknowledge that it is difficult to
pick up these languages but claim that, if you persevere, you sooner or
later reach a state of computational satori in which it all makes
sense. Interestingly enough, these languages often have books which
approach scriptural status e.g. SICP for Scheme.

So (assuming my classification makes sense) which is Python? The
emphasis on simplicity and the beginner-friendly nature of it seems to
put it in the tool category. On the other hand, the emphasis on the ONE
TRUE WAY to accomplish most tasks and the tendency for participants in
this newsgroup to criticize one another's code as being "unpythonic"
seems to move it towards the Zen category. Of course, even tool
languages have their idioms which the novice needs to pick up, so maybe
this isn't decisive, but I detect an element of zeal in this newsgroup
that I don't detect in (say) Excel VBA programming newsgroups.

No value judgement is intended by my classification. There is no
denying that Zen languages are often very powerful tools (for those who
have reached satori) and that there is a Zen to really mastering, say,
C. Personally, I have never been able to master any Zen language but
can pick up tool languages fairly quickly, so I prefer tool languages.
This is probably because I am not a programmer (I'm a mathematician who
likes to program as a hobby and for numerical simulations) and so don't
have the time to invest in picking up a Zen language. Hard-core hackers
might presumably lean towards the Zen languages.

Just curious

-John Coleman
 
J

John Coleman

Ron said:
Actually, Python has the distinction of being both a great tool
language *and* a great Zen language. That's what makes Python so cool
;-)))

Ron Stephens
Python411
www.awaretek.com/python/index.html

This would explain why the question is so hard to answer. It is a
slam-dunk that Lisp is Zen and VBA is tool - but python really is a bit
hard to classify. This is somewhat similar to the way that python seems
to straddle the gap between imperative and functional languages. It has
something from each worlds (whether it has the *best* from each world
is a separate question)

-John Coleman
 
M

Max Erickson

Given that python code is often described in terms of being 'pythonic' or
not, and that pythonic is a term that is apparently well agreed upon yet
seemingly impossible to define for someone who does not already understand
the word, python is probably a zen language.

max
 
K

Kent Johnson

John said:
Greetings,
I have a rough classification of languages into 2 classes: Zen
languages and tool languages. A tool language is a language that is,
well, a *tool* for programming a computer. C is the prototypical tool
language. Most languages in the Algol family are tool languages. Visual
Basic and Java are also tool languages. On the other hand, a Zen
language is a language which is purported to transform your way of
thinking about programming. Lisp, Scheme, Forth, Smalltalk and (maybe)
C++ are Zen languages. Disciples acknowledge that it is difficult to
pick up these languages but claim that, if you persevere, you sooner or
later reach a state of computational satori in which it all makes
sense. Interestingly enough, these languages often have books which
approach scriptural status e.g. SICP for Scheme.

So (assuming my classification makes sense) which is Python?

Expanding on what Alex said :)

Python is an excellent tool language, it is very pragmatic and powerful
and makes it (relatively) easy to just get stuff done.

Python has one of your 'zen' aspects - using Python has definitely
expanded the way I think about programming. Powerful built-in support
for lists and dicts, first-class functions and easy introspection enable
a style of programming that is difficult or impossible in Java and C++.

But Python is not difficult to pick up - it is notably easy - and I
don't think anyone claims it leads to computational satori - it's more
an attitude of "try it, you'll like it!". Using Python does seem to
spoil people - I for one hate to code in Java now. Maybe "bliss" is a
better word for it than "satori".

Kent
 
?

=?iso-8859-1?q?Luis_M._Gonz=E1lez?=

I don't know if python is Zend.
It's quite minimalistic and it "flows" very well, so I guess it is a...
"Feng-shui" language?
 
T

Terry Reedy

an interesting statement and question.
....
So (assuming my classification makes sense) which is Python? The
emphasis on simplicity and the beginner-friendly nature of it seems to
put it in the tool category. On the other hand, the emphasis on the ONE
TRUE WAY to accomplish most tasks and the tendency for participants in
this newsgroup to criticize one another's code as being "unpythonic"
seems to move it towards the Zen category.
,,,

An 'emphasis on the ONE TRUE WAY' would not be pythonic ;-)
Sorry you got that misimpression.

For the Zen of Python, type 'import this' at an interactive prompt.
One of the lines is

'There should be one-- and preferably only one --obvious way to do it.'

This is intentionally more nuanced, and practical, than your paraphrase.

I agree with the 'both' answer.

Terry Jan Reedy
 
T

Twig

Kent said:
Expanding on what Alex said :) *snip*

Python is an excellent tool language, it is very pragmatic and powerful *snip*

Kent

"It's a good axe", Muddy waters said about his guitar when asked by some
heavy-mega guitar hero.

Python is practical tool for practical problems. But if problem isn't
practical, it is misdefined.
 
B

Bryan Olson

John said:
I have a rough classification of languages into 2 classes: Zen
languages and tool languages. A tool language is a language that is,
well, a *tool* for programming a computer. C is the prototypical tool
language. Most languages in the Algol family are tool languages. Visual
Basic and Java are also tool languages. On the other hand, a Zen
language is a language which is purported to transform your way of
thinking about programming. Lisp, Scheme, Forth, Smalltalk and (maybe)
C++ are Zen languages.

I think that's a horrible classification. Every language is both.
"Transform your way of thinking" from what? There is no
distinguished canonical view of what a programming language looks
like, from which all others must be strange and wondrous
transformations.

Lisp and Forth are not tools for programming a computer? Of course
they are. Algol and Java don't transform people's thinking about
programming? Nonsense.
 
J

Jorgen Grahn

I think that's a horrible classification. Every language is both.

I agree; it's horrible as a classification.

But it's interesting concepts. One might use them to discuss the design of
various languages, and how the users treat them -- as long as one doesn't
get carried away.

Too bad Larry Wall doesn't post to this group.

/Jorgen
 
J

John Coleman

Bryan said:
I think that's a horrible classification. Every language is both.
"Transform your way of thinking" from what? There is no
distinguished canonical view of what a programming language looks
like, from which all others must be strange and wondrous
transformations.

Lisp and Forth are not tools for programming a computer? Of course
they are. Algol and Java don't transform people's thinking about
programming? Nonsense.

You seem to have completly overlooked both the hedge word "rough" in my
first sentence and the qualifications in my third paragraph. I probably
was not sufficiently clear that I was describing some fairly sunjective
impressions. It is a simple observation that devotees of the Scheme
language view their language as more than *just* a tool for programming
computers. To quote from the introduction to the first edition of SICP:

"we want to establish the idea that a computer language is not just a
way of getting a computer to perform operations but rather that it is a
novel formal medium for expressing ideas about methodology"
(http://mitpress.mit.edu/sicp/full-text/book/book.html).
It is also a simple observation that experts in VBScript *don't* walk
around talking like that. Scheme and VBScript are of course both Turing
complete, but they seem to have radically different cultures. Do you
disagree? Or, if you agree that there is a difference but don't like
the words "Zen" vs. "tool" to describe it, how would you articulate the
difference?

Again, just curious.

-John Coleman
 
C

Claudio Grondi

John said:
Greetings,
I have a rough classification of languages into 2 classes: Zen
languages and tool languages. A tool language is a language that is,
well, a *tool* for programming a computer. C is the prototypical tool
language. Most languages in the Algol family are tool languages. Visual
Basic and Java are also tool languages. On the other hand, a Zen
language is a language which is purported to transform your way of
thinking about programming. Lisp, Scheme, Forth, Smalltalk and (maybe)
C++ are Zen languages. Disciples acknowledge that it is difficult to
pick up these languages but claim that, if you persevere, you sooner or
later reach a state of computational satori in which it all makes
sense. Interestingly enough, these languages often have books which
approach scriptural status e.g. SICP for Scheme.

So (assuming my classification makes sense) which is Python? The
emphasis on simplicity and the beginner-friendly nature of it seems to
put it in the tool category. On the other hand, the emphasis on the ONE
TRUE WAY to accomplish most tasks and the tendency for participants in
this newsgroup to criticize one another's code as being "unpythonic"
seems to move it towards the Zen category. Of course, even tool
languages have their idioms which the novice needs to pick up, so maybe
this isn't decisive, but I detect an element of zeal in this newsgroup
that I don't detect in (say) Excel VBA programming newsgroups.

No value judgement is intended by my classification. There is no
denying that Zen languages are often very powerful tools (for those who
have reached satori) and that there is a Zen to really mastering, say,
C. Personally, I have never been able to master any Zen language but
can pick up tool languages fairly quickly, so I prefer tool languages.
This is probably because I am not a programmer (I'm a mathematician who
likes to program as a hobby and for numerical simulations) and so don't
have the time to invest in picking up a Zen language. Hard-core hackers
might presumably lean towards the Zen languages.

Just curious

-John Coleman
I was lately involved in some very long threads trying to answer the
question what a simple assignment operator does and what is behind a
Python identifier (variable).

In the context of the above mentioned experience I agree with the
notion, that from the beginner point of view, as long as there is no
need to get deep understanding what goes on behind the scenes, Python is
a tool.

At that moment, when it becomes necessary to optimize the code for speed
and understand the exact details of what is going on behind the scenes
Python turns into a mystery which needs time, effort and ability to
grasp new concepts in order to gain control over it, i.e. Python reveals
its Zen character.

In this context it appears to me worth to mention, that in my eyes a
'pythonic' way of programming has not necessarily something to do with
the Python language itself.
Even if it is sure better to use Python for 'pythonic' way of
programming, it can also be done using any other programming language.
I assume, that many of todays advanced Python users were already aware
of the 'pythonic' way of programming long before they started to use
Python. In Python they found many of the tools they have developed for
themselves over the time already built-in and even some more, so they
embraced it as programming language of their choice and coined the way
it helps to code ideas as 'pythonic' way of programming.
This is in my eyes the reason why 'pythonic' way of programming can
usually be fully understood only by very experienced programmer who
already went all the stages through many other programming languages to
Python and use it where it is appropriate being at the same time aware,
that there are purposes for which Python is not the way to go and being
aware which problems other programming languages have were solved by the
design of the Python language.
So 'pythonic' way of programming has only a meaning for an _experienced
programmer_ as intuitively easy to understand and in different context
easy to reuse way of programming where the initial idea must not be
bended to fit into the programming language, but where the programming
language provides by own design some aid in expressing it.

I don't see how Microsoft Visual Basic fits into the category of tool
languages. As MS-DOS Quick Basic surely do, Visual Basic/Visual C++ need
a total new understanding of programming and belong due to the very hard
to grasp event driven way not allowing any workaround it to the category
of Zen languages. There is the 'hidden' event handling and the way from
the GUI to the code and not other way what makes Visual Basic in my eyes
a Zen language where Basic, Algol, Fortran, C are tools.

If it makes sense to speak about tool and Zen languages at all, I will
draw the line between the two categories depending on the amount of from
the programmer hidden amount of code added to his own code in order to
make the program run.
Assembler, as it runs entirely as it is written is sure a tool.
C/C++ is also a tool, as long as it does not extensively use large
libraries providing special functionality.
Usage of for example C++ build upon the MFC library (Microsoft
Foundation Class) makes in my eyes C++/MFC a kind of Zen language out of
a C++ tool.
Forth belongs according to this definition to the category of Zen
languages not because it is so different, but, because you have to track
in own mind, that behind the scenes the next command will use what was
put on the stack before, what makes part of the processing done 'hidden'
behind the scenes.

From the experience of the in another thread currently going on hot
discussion about Python and Lisp I draw the conclusion, that it is from
todays point of view not easy to draw exact lines between the categories
like tool/Zen, interpreted/compiled language.
In between even making a difference between software/hardware appears to
me problematic.

Claudio
 
K

Kay Schluehr

John said:
This would explain why the question is so hard to answer. It is a
slam-dunk that Lisp is Zen and VBA is tool - but python really is a bit
hard to classify. This is somewhat similar to the way that python seems
to straddle the gap between imperative and functional languages. It has
something from each worlds (whether it has the *best* from each world
is a separate question)

-John Coleman

There is something that worries me about Lisp. If you are interested in
the history of Lisp and some non-technical aspects of its culture I can
recommend the writings of Richard Gabriel, who was one of the leaders
of the CL standardisation commitee and founder of the Lisp company
Lucid in the mid 80s that gone down a few years later. As it turned out
that time Lisp was not capable to survive in what we call today a
"heterogenous environment". It was strongly too self-centered. So I
would actually invert you categories and say that a good tool achieves
to have a non-dual nature instead of a strong I. With Lisp you might be
a god but according to the Zen philosophy a god is a subordinated
character that preserves the illusion of self-identity. A fine thing
about a tool in this context is that you have to define its identity by
a relationship to something that it is not.

I have at times the impression that many people who talk about Zen
philosophy confuse it with some home brewn mixture of platonism with
its transgressive move towards the true reality, a stoic hedonism of
contemplation and the taoistic being-in-doing. Zen on the other side is
more radical: if you erase yourself there is no-one "who" is in the
flow but chances are that you and the computer over there are the same
thing.

Kay
 
P

Paul Rubin

Kay Schluehr said:
I have at times the impression that many people who talk about Zen
philosophy confuse it with some home brewn mixture of platonism with
its transgressive move towards the true reality, a stoic hedonism of
contemplation and the taoistic being-in-doing. Zen on the other side is
more radical: if you erase yourself there is no-one "who" is in the
flow but chances are that you and the computer over there are the same
thing.

QOTW or something.
 
N

none

John said:
You seem to have completly overlooked both the hedge word "rough" in my
first sentence and the qualifications in my third paragraph. I probably
was not sufficiently clear that I was describing some fairly sunjective
impressions. It is a simple observation that devotees of the Scheme
language view their language as more than *just* a tool for programming
computers. To quote from the introduction to the first edition of SICP:

"we want to establish the idea that a computer language is not just a
way of getting a computer to perform operations but rather that it is a
novel formal medium for expressing ideas about methodology"
(http://mitpress.mit.edu/sicp/full-text/book/book.html).
It is also a simple observation that experts in VBScript *don't* walk
around talking like that. Scheme and VBScript are of course both Turing
complete, but they seem to have radically different cultures. Do you
disagree? Or, if you agree that there is a difference but don't like
the words "Zen" vs. "tool" to describe it, how would you articulate the
difference?

Again, just curious.

It's a metter of perspective. Python didn't change my thinking about
programming. Smalltalk changed my way of thinking about programming
very radically. All Python changed my thinking about was how to better
program in Python. Python to me just happened to be a very pragmmatic
and productive tool for getting the job done. It happens to be
comfrotable because large parts of it already fit into my way of
thinking from long use in Smalltalk, but my description of Pythong would
be 'cleanly practical' not 'zen'
 
S

Steven D'Aprano

Greetings,
I have a rough classification of languages into 2 classes: Zen
languages and tool languages. A tool language is a language that is,
well, a *tool* for programming a computer. C is the prototypical tool
language. Most languages in the Algol family are tool languages. Visual
Basic and Java are also tool languages. On the other hand, a Zen
language is a language which is purported to transform your way of
thinking about programming. Lisp, Scheme, Forth, Smalltalk and (maybe)
C++ are Zen languages. Disciples acknowledge that it is difficult to
pick up these languages but claim that, if you persevere, you sooner or
later reach a state of computational satori in which it all makes
sense. Interestingly enough, these languages often have books which
approach scriptural status e.g. SICP for Scheme.

So (assuming my classification makes sense) which is Python?

Why can't it be both? Why do you think "Zen" and "tool" are two different
*kinds* of language, rather than just two extremes of a single continuum?

There are two kinds of people: those who divide the world into false
dichotomies, and those who don't. *wink*

This is probably because I am not a programmer (I'm a mathematician who
likes to program as a hobby and for numerical simulations) and so don't
have the time to invest in picking up a Zen language. Hard-core hackers
might presumably lean towards the Zen languages.

Regardless of whether Python is a Zen or tool language, or both, or
something else, it is incredibly easy to pick up. Just remember, and this
goes for *any* new language you are trying to learn, Python is not
C/Java/VB/Fortran/Lisp/Ada/whatever language you already know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top