Teaching : Python, Scheme, Java...

Steven Taschuk staschuk at telusplanet.net
Fri Apr 18 12:44:38 EDT 2003


Quoth Jean-Paul Roy:
  [...]
> Let me cite the Normalization Report on Scheme:
> 
> "Programming languages should be designed not by piling feature on top 
> of feature, but by removing the weaknesses and restrictions that make 
> additional features appear necessary."
> 
> And so the wile or for... loops could be defined in Python as in Scheme 
> with the tail recursion optimzation.

Let me paraphrase another source:  "A programming language should
be as simple as possible, but no simpler."  :)

  [...]
> My teaching experience is that students knowing loops through the while 
> construct actually *understand* the concept of iteration when they see 
> that it is modelized by a tail recursive function which transforms a 
> "vector of loop variables" (a state vector). Then, it is only a GOTO 
> which passes arguments. I'm really happy to teach that way.

A nice point.

I wrote earlier that tail recursion is an obfuscated way of
writing iteration; I see now that I misunderstood what you're
teaching.

For teaching simply how to program, explicit loop syntax is better
than tail recursion imho, since it makes the programmer's intent
more explicit.  For teaching theory, tail recursion is better,
since it makes the state vector more explicit (as an argument list
to the tail-recursive function, rather than implicit in the
environment).

-- 
Steven Taschuk                            staschuk at telusplanet.net
Every public frenzy produces legislation purporting to address it.
                                                  (Kinsley's Law)





More information about the Python-list mailing list