Problem with recursion? (was [plt-scheme] Re: Novice needs help writing function )
> 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.
I've taught recursion to arty types with no prior programming experience
in the context of graphics, usually by drawing a row of cubes, followed by
a tree of cubes in fluxus (as it's a simple modification from one to the
other).
Predictably Escher usually comes into it somewhere too:
http://www.flickr.com/photos/transphormetic/279760855/in/set-72157594345591539/
I'm not trained as a teacher (or computer scientist) so I'm probably not
very good at it, and also I throw it at them very early on. I've noticed
it's the difference between the process and the procedure definition that
some people have a hard time following - the idea of a procedure calling
itself means that they are forced to separate them.
I don't think this is better than a mathematical explanation, it really
depends on the individual I guess.
cheers,
dave