[Edu-sig] Naming in Python
Christian Mascher
christian.mascher at gmx.de
Sat Jan 29 21:58:21 CET 2005
Arthur wrote:
> Python is a "naming" language. The interpreter is working with assigned
> names of objects more directly and more significantly than in other
> languages (of which I am aware).
I can imagine of one, see below.
> As a programmer, one is conversing with the
> interpreter by way of these names, as names and objects are closely bound.
You mention two special features:
1. Every "variable" is _always_ just a pointer/reference to an
individual object. So most of the time you don't even have to think of
this level of indirection. And you can assign just about anything to a name.
2. "Live objects" can be examined on the spot in the interpreter.
You don't have this in compiled languages. Interestingly instructors in
Java seem to like this feature , too. When the language doesn't provide
for it, you need an intermediate (interpreter-like) program to simulate
the experience. Take the BlueJ-environment, where you can manipulate
objects in a comparable way (or even through uml-editors and such).
Still, this is not only a feature of the language as such, but also of
the "environment" or the tools you use together with the language. It's
not being interpreted alone, it's the IDLE-shell (rather than the simple
command-line), the dir() function, the always accessible module code,
documentation close to the source and the flexibility in assigning names
whenever you want to.
I have found one language which is very similar to Python in respect to
the two mentioned characteristics and that is Smalltalk. The
variable-concept (everything is an object, every variable a pointer),
and the "live environment"-approach to programming are both going back
at least as far as Smalltalk-80. (Didn't Guido mention Smalltalk as one
of his influences somewhere?)
I think both languages "feel" very similar in this way. You can interact
with live objects, change them in small steps, examine them (e.g. dir()
in Python, inspect in Smalltalk). Programming is fun in both cases. Who
needs .exe-files really?
Christian
More information about the Edu-sig
mailing list