Newsgroups: comp.lang.dylan,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gvls1!gvls1!dave
From: dave@gvls1.vfl.paramax.com (David Lee Matuszek)
Subject: Re: Prefix syntax
Message-ID: <1995Mar23.150306.4307@VFL.Paramax.COM>
Sender: dave@gvls1 (David Lee Matuszek)
Nntp-Posting-Host: yggdrasil
Organization: Paramax Systems Corporation, Paoli, PA
References: <18426.9503201324@subnode.aiai.ed.ac.uk> <neves-2003951134150001@129.105.100.185> <hbaker-2103951221550001@192.0.2.1> <1995Mar22.171609.167@den.mmc.com>
Date: Thu, 23 Mar 1995 15:03:06 GMT
Lines: 48
Xref: glinda.oz.cs.cmu.edu comp.lang.dylan:3841 comp.lang.lisp:17161

In article <1995Mar22.171609.167@den.mmc.com>, britt@tigercat.den.mmc.com (Dan Britt) writes:
|> In article <hbaker-2103951221550001@192.0.2.1>, hbaker@netcom.com (Henry Baker) writes:
|> ...
|> |> Re recursion:  In my experience of teaching undergraduates, recursion is
|> |> far easier to teach and understand than iteration.  The _only_ people who
|> |> had any problem with recursion were those who had had their brains damaged
|> |> (perhaps permanently) due to early exposure to Basic and/or assembly
|> |> language.
|> 
|> I beg to differ.  Recursion is conceptually much more complex due to the
|> need to imagine multiple calls to a function INSIDE that function, with
|> different arguments.  Getting the stopping condition right can be a pain.
|> (Though in truth I may have some lingering impairment from exposure to
|> Forth, FORTRAN, IDL, RTPL, C, Pascal, etc. :-))

Gee, I get to disagree with both of you!  :-)

I disagree with Henry Baker in the cause of having problems with recursion.
In my not-so-humble opinion (I've been teaching CS since 1969), the reason
people have trouble with recursion lies in the way it is taught.  Prior
knowledge of BASIC, much as I hate to admit it, is correlated with better
grades in introductory Pascal classes.

I disagree with Dan Britt that recursion is more complex than iteration.
But you are right -- if you need to imagine multiple calls to a function
INSIDE that function, then it IS very complex.  And, unfortunately, that's
the way recursion is always taught.

I have a ten- or twelve-page paper on how to teach recursion the right way
which I wish I could post, but unfortunately it's not in machine-readable
form (I wrote it a long time ago).  Here's a too-quick summary of one of
the main ideas:

When you write a function X that calls a function Y, you don't have to
step through function Y in order to determine whether function X is correct.
You just assume Y is correct (and check it separately, at some other time).
Thus you can debug X without worrying about Y.  The trick in doing recursion
easily is to teach yourself to do this even when X = Y.

Sadly, every textbook that I know of teaches just the opposite: that to
understand recursion, you have to step through multiple levels.  This is
Wrong.



  -- dave@vfl.paramax.com -- If my header says otherwise, it lies.

In memoriam:  The Space Age, 1969-1972.
