Teaching : Python, Scheme, Java...

Steven Taschuk staschuk at telusplanet.net
Thu Apr 17 17:59:00 EDT 2003


Quoth Jean-Paul Roy:
> I'm teaching Scheme in our Univ. to 2nd year students. The cursus is now:
  [...]
> Now, is it a good move to swap from Java to Python in 1st year ? Some of 
> us find Java a bit heavy for algorithmics. The probable discussion will 
> be about:
  [...]
> - Pyhton is bad : recursion limit (I am astonished at that one)

Although it's a bit annoying in principle, I've never found the
recursion limit to be a problem in practice.  (But then, I don't
usually implement Ackermann's function.)

> - Python is bad : tail recursion is not iterative (also astonished at 
> that, I can understand with an interpreter, but compiler ?)

For teaching purposes, imho tail recursion is a Bad Thing.

Writing an iterative process using tail recursion has always
struck me as a clever but obfuscated technique.  Write what you
mean: if you want an iterative process, write a loop; if you want
a recursive process, make recursive calls.

Conversely, it's easier to explain that a call always involves
stack growth, while a loop does not, instead of having to explain
that the compiler is under some circumstances able to do a call
without stack growth.

Talk about tail recursion when you start teaching the wee ones
about more advanced topics to which it is directly relevant, such
as compiler implementation, how loops might be implemented under
the hood, and so forth.

> - Python is bad : we are obliged to use message passing paradigm to add 
> an element to a list (it's ok for me but some of us get angry with 
> objects for beginners)

I'd like to hear more about this objection.  Is it that those who
object to objects (heh) feel they should be a more advanced topic?

  [...]

-- 
Steven Taschuk                                        staschuk at telusplanet.net
"Study this book; read a word then ponder on it.  If you interpret the meaning
 loosely you will mistake the Way."         -- Musashi, _A Book of Five Rings_





More information about the Python-list mailing list