[TriZPUG] "Use of the Words 'Variable' and 'Assignment' Considered Harmful in Python"

Tom Roche Tom_Roche at pobox.com
Thu Sep 29 19:16:26 CEST 2011


David Handy Thu, 29 Sep 2011 11:13:49 -0400 (rearranged)
> sorry if I'm getting too pedantic.

No need--informatics is one discipline where pedantics are demanded, notably by CPUs.

Tom Roche Thu, Sep 29, 2011 at 09:33:47AM -0400
>> "Variable assignment" is a common informatic idiom, and it *seems*
>> pretty similar to what's happening in

>> $ python -c 'i=1 ; print i'

> The potential harm is that it tends to communicate the wrong
> conceptual model. This isn't like C or assembly language, where
> there is a memory location labeled "i" and we're stuffing the
> integer 1 in that memory location.

Correct, but that to me says less about the use of the term "variable
assignment" (with which the parallelism to other languages is plain)
and more about the differing implementation of variables. Python
variables are implemented by objects managed by the VM; in other
languages, variables map to memory locations managed by you. (Am I
missing something?) That's a distinction which I don't see the term
"binding a name to an object" necessarily communicating much better
than "assigning a value to a variable"--YMMV.

> You must have a proper concept of Python's programming model in
> order to predict what a python program will do.

True that.

FWIW, Tom Roche <Tom_Roche at pobox.com>


More information about the TriZPUG mailing list