Fwd: Re: [Edu-sig] Why is Logo popular, while Python isn't? (was "using Python for a CS 2 course" )

Mats Wichmann mats@laplaza.org
Thu, 21 Nov 2002 12:44:11 -0700


 >So, I think it may well be worth using Python, even if it is slightly
 >sub-optimal for teaching.  But I think it *does* have some non-intuitive
 >features -- at least from a seven-year-old's point of view.  Personally I
 >think the most obnoxious is the lack of simple loop constructs:
 >
 >for i in range(10):
 >    print i
 >
 >is not very intuitive to kids who don't know about domains and ranges --
 >fairly advanced math concepts, even if they seem trivial to me now.
 >
 >for  1 < = i < 10:
 >
 >would be more intuitive and Pyrex comes very close to this, with:
 >
 >for i from 1 <= i < 10:

Sigh. Python's "for" loop is more intuitive than most
because you're explicit about what you're looping through.

for number in in 0,1,2,3,4,5,6,7,8,9:

for color in "red", "blue", "green":

etc.

Of course, you can save your sequence as a "variable",

colors = ("red", "blue", "green")
for color in colors:

for the *special case* where you want to loop through
a numerical sequence you can use a helper tool named
range() to generate that sequence.

 >I just bring them up, because they are teaching
 >obstacles for younger kids.

Really, they're teaching obstacles for the teacher (grin).
Our challenge is to not make them learning obstables
for the kids... and sometimes our own programming
background leads us to choose a non-optimal way to
present a topic (my own first four seriously used
programming languages were Fortran II, Basic, Pascal,
and C ... guess what I tend to draw from?)