Variables

Bengt Richter bokr at oz.net
Sun Apr 24 03:17:47 EDT 2005


On Sun, 24 Apr 2005 00:59:45 -0400, Richard Blackwood <richardblackwood at cloudthunder.com> wrote:

>Bengt Richter wrote:
>
>>On Sat, 23 Apr 2005 22:45:14 -0400, Richard Blackwood <richardblackwood at cloudthunder.com> wrote:
>>
>>  
>>
>>>Robert Kern wrote:
>>>
>>>    
>>>
>>>>Richard Blackwood wrote:
>>>>
>>>>      
>>>>
>>>>>To All:
>>>>>
>>>>>   Folks, I need your help. I have a friend who claims that if I write:
>>>>>
>>>>>foo = 5
>>>>>
>>>>>then foo is NOT a variable, necessarily. If you guys can define for 
>>>>>me what a variable is and what qualifications you have to back you, I 
>>>>>can pass this along to, hopefully, convince him that foo is indeed a 
>>>>>variable.
>>>>>        
>>>>>
>>>>None of us can do that unless you tell us what he thinks the word 
>>>>"variable" means. The terminology is a bit fluid. I suspect that your 
>>>>friend applying a somewhat restricted notion of "variable" that 
>>>>coincides with the behavior of variables in some other language.
>>>>
>>>>      
>>>>
>>>Indeed, this language is math. My friend says that foo is a constant and 
>>>necessarily not a variable. If I had written foo = raw_input(), he would 
>>>say that foo is a variable. Which is perfectly fine except that he 
>>>insists that since programming came from math, the concept of variable 
>>>is necessarily the identical. This can not be true. For example, I may 
>>>define foo as being a dictionary, but I can not do this within math 
>>>because there is no concept of dictionaries within mathematics; yet foo 
>>>is a variable, a name bound to a value which can change.
>>>    
>>>
>>
>>Maybe he doesn't know that foo = 5 in Python is not an equation as in math,
>>but a Python source language statement to be translated to a step in some
>>processing sequence.
>>
>>Tell him in Python foo is a member of one set and 5 is a member of another,
>>and foo = 5 expresses the step of putting them into correspondence
>>to define a mapping, not declaring them equal.
>>  
>>
>Could I honestly argue this to him? From what basis do I argue that it 
>is not an equation? In any event, he would likely (passionately) 
>disagree considering his notion that programming is an off-shoot of math 
>and thus at the fundamental level has identical concepts and rules.
And that is supposed to mean that "x" in any context must be taken as "x"
in the context of whatever math book he's thumping? A program source text
is not (or rarely ;-) a mathematical proof text. You run the texts through
different interpreters. The interpreters make the difference between x=5 and x=5 ;-)

Apparently your friend has only one 'x'-interpreter at his disposal in his mind,
or he is pushing one like an off-line troll. He is trying to run a Python
program with his math interpreter, not the python interpreter.

>Believe it or not, he used to be a programmer. Back in the day (while I 
>was getting my PhD in philosophy), he was a employed programmer using 
>Cobol, Fortran, and other languages like that. Did his seemingly 
>peculiar definition of variable exist at that time?
Sure, there have always been people attached to peculiar definitions.
People fall in love with patterns of limited-applicability partial truth,
because it serves to simplify their perceived world, and may actually
fit experience of a limited part of the world well for a time,
which reinforces confidence, and they can act without too much thinking.
Altering the pattern to fit a more complex reality is mental work
and a threat to comfort, and possibly self esteem, depending on how they
relate to their ideas. If they think of their concepts as personally as tattoos,
they may not like your ideas for revisions. But if they think of ideas
as more or less serviceable reality-maps being drawn and revised
as you go, they will be more than happy to compare maps and talk about
the adventure of the pigrimage and what good exercise it is ;-)

>
>>Even in math notation, ISTM important to distinguish between
>>a finger and what it may for the moment be pointing at.
>
Does your friend distinguish between the "x" on the page where
he has written his math equation, and whatever he thinks of when
he interprets the "x"? When he says, "x" is <whatever>, what "x"
is he talking about? Does he realize how many distinctions can be made?

Maybe it's time to change the subject ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list