Problem with recursion? (was [plt-scheme] Re: Novice needs help writing function )

From: Yavuz Arkun (yarkun at gmail.com)
Date: Fri Jan 4 09:16:17 EST 2008

Bill Wood wrote:
> On Fri, 2008-01-04 at 13:00 +0200, Yavuz Arkun wrote:
>    . . .
>   
>> And while I am on the subject of examples, why do introductory 
>> programming books use so many mathematical examples? IMVHO, there are 
>> only three subjects that can interest a young student: sex, video games 
>> and programming tools. Putting the first two aside for PC, an example 
>> about an text editor would be much more interesting than, say, Fibonacci.
>>     
>
> Careful with that.  I was entranced with numbers as early as the third
> grade, and I had friends all the way through school who were also.
> Don't disenfranchise such youth in the name of broad appeal.  I came
> upon programming much later (college age), and I found recursion
> fascinating and appealing precisely because you could compute my old
> friends the Fibs in the same way they were defined.  The efficiency
> difference between recursion and iteration was such a let-down.
>
>  -- Bill Wood
>
>
>
>   
Yes, I agree that mathematics is interesting for some people, including 
me. However, I took the OP to mean that there is a large chunk 
(majority? sizable minority? undesirably large in any case) of the 
student body who are unable to understand recursion as it is usually 
covered. For them, something else needs to be done (other then giving up 
teaching recursion.)

BTW, I first learned about the Fibonacci series in high school, and we 
were told they are generated by "start with 1, 1, and then add the last 
2 together to get the next one...", e.g. iteratively. For me the 
recursive definition is contrived, and I saw it for the first time in 
intro programming books. I guess this shows that prior teaching of 
iterative style kills some neurons forever.

Anyway, probably everyone has their favorite example/exercise style. 
Mine happens to be programming tools. My ideal introductory programming 
text would be built around an extended series of examples/exercises that 
construct increasingly complete instances of a tool, say a text editor, 
or even a compiler, that leads to a simple, but real-world program. 
Maybe someone could deconstruct Emacs and rebuild it as a teaching 
exercise? ;)

Yavuz


Posted on the users mailing list.