Python article in Free Software Magazine

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sun Jan 1 02:06:10 EST 2006


On Sat, 31 Dec 2005 14:42:36 -0600, Kirk Strauser wrote:

> I wrote this article which was published in Free Software Magazine:
> 
> http://www.freesoftwaremagazine.com/free_issues/issue_09/intro_zope_1/
> 
> It's intended as a high-level overview of the language, and therefore
> glosses over some of the details.  For example, I describe its function
> calling mechanism as pass-by-reference, because that's close enough for
> newcomers to get the gist of it.

Then what you are describing is not Python, it is some mythical language
that is almost like Python, but just enough like C to confuse programmers
who think they have discovered a bug when the following doesn't work:

def increment(n, inc=1):
    n += inc

n = 1
increment(n)
assert n == 2


Firstly, do no harm: if you aren't prepared to bite the bullet and say
"call by object" or "call by object reference", then just don't do
it. It is better to not say what Python is than to describe it as
something it is not. Please don't invoke all the C baggage in developers'
minds by calling it call by reference.

I don't want to nit-pick all my way through the article, which
is very decent and is worth reading, but I will say one more thing: you
describe Python as "an expressive, interpreted language". Python is no
more interpreted than Java. Like Java, it is compiled into byte-code which
is then executed by a virtual machine. It has a separate compilation and
execution step.

(Amazing how the Java virtual machine is one of the great buzz-word
selling features of the language, and yet Python people take it utterly
for granted.)

We both know that rational people shouldn't care about the difference
between compilers and interpreters: it is performance that counts, not
how you get it. We know that Python doesn't literally analyse the source
code over and over again, and no major interpreted language has done this
for probably two decades or more. We can argue about the differences
between interpretation, tokenization, compilation and execution, and
pedants like me will mention that machine code is interpreted by the CPU.

But sadly, many decision makers don't understand these subtleties. To
them, compiled languages like C++ and Java are Good, interpreted languages
are Bad and doomed to be slow and weak. As soon as you describe
Zope/Python as "interpreted", you turn off maybe 25% or 50% of the Pointy
Haired Bosses who are making the decision of what technologies are used.

Buzz-words like "interpreted" and "compiled" trigger frames in the
reader's mind. They have connotations. You, as the author, aren't
responsible for the wrong-headed frames that many readers will bring
to the article, but you should be aware of them and work around them if
you can.



-- 
Steven.




More information about the Python-list mailing list