Iterative vs. Recursive coding

News123 news1234 at free.fr
Fri Aug 20 09:47:30 CEST 2010


On 08/20/2010 02:26 AM, Steven D'Aprano wrote:
> On Thu, 19 Aug 2010 22:00:16 +0000, Martin Gregorie wrote:
> 
>> Recursion can be quite a trick to get your mind round at first
> 
> Really? Do people actually find the *concept* of recursion to be tricky?
Is this a sincere surprise or are you just boasting?
> 
> If I remember correctly, my puzzlement about recursion lasted about 15 
> seconds. I remember thinking "How does the function foo know that there 
> is a function foo when foo doesn't fully exist yet?", but once I accepted 
> the fact that it just does it all just seemed obvious. Getting recursion 
> *right* is sometimes tricky, but the idea itself isn't.

Well there's two things where I remember, that at least quite some
people in our class (at least the ones who didn't do maths or
programming in their spare time) had problems with.

This were recursion and Mathematical induction. (quite the same though)

The fact, that you didn't have the issue doens't mean it's easy for others.






More information about the Python-list mailing list