Guide to the python interp. source?

Tim Gahnström /Bladerman tim at bladerman.com
Mon Jul 29 04:29:41 EDT 2002


"Terry Reedy" <tjreedy at udel.edu> skrev
> "Tim Gahnström /Bladerman" <tim at bladerman.com> wrote in message
> news:bxX09.1437$HY3.398059 at newsc.telia.net...
> > ask a complete novice what he think this peace of code will do
> >
> > #Here is the program
> > x=3
> > inc(x)
> > print x
> >
> > #Bellow is al the function deffinitions
> > def inc(x):
> >     x= x+1
>
> Your example is deceptive and biased because you use the same name for
> the global and local vars, which is known to be confusing to complete
> novices, let alone those with more experience.  They will tend to
> think that they are the same thing and give the wrong answer on the
> basis of that misconception.  Much better is
>
> def inc(temp):
>   temp = temp+1
>
> > You might have to tell him about assignment but not much else for
> him to
> > understand that this program will print 4
>
> I tried your experiment with my wife, who is not even a novice w/r/t
> computer programming.  She first refused to answer.  When she

Hmm,
Okey. Now we are running two discussions in paralell. One about if it is
possible and one about if it is good.

Maybe I am wrong in both cases, the first case is getting to seem obvious
but I am not really convinced yet about the second. I will have to sit down
and think it over a little.
But either reason is enough for me to drop the feature.
There is actually a third reason to drop it that I have had in my mind since
I started. It is good to have it much similar to how most languages work
today, namely by CBV.

By the way, I won't even dare to tell you guys about the mess I have thought
out for the way I intend to handle objects, classes and imports :-)

The thesis is not about making a CBR language but make an IDE with debugger
for a language suited for novices.

Tim







More information about the Python-list mailing list