17 comments

[ 2.5 ms ] story [ 47.4 ms ] thread
> First, then, a not-too-serious dictionary definition:

> Recursion (rĭ-kûr’-zhən) noun. See recursion.

I like this version:

To understand recursion, you must first understand recursion.

I also like self-referential music, such as Carly Simon's "You're so vain"

> You probably think this song is about you

Recursion is recursion, obviously.
I find that recursion is something that in simple cases can be replaced with a loop, and in complex cases is hard to reason about and therefore should be avoided.
Recursion is just spiral reasoning. It looks like circular reasoning, but if you keep going with it the curve keeps getting smaller until eventually you reach the trivial case.
Honestly, this is the best single-line definition for a non-specialist I have ever seen.
How many single line definitions for non-specialists have you seen?
I have myself tried to explain recursion many times to those who do not understand it. While I do well, this is significantly more succinct than what it would take for me to succeed with most, and provides a clear visual. Nicely done.

I’ll probably be stealing that metaphor.

Please, credit it to Euler.
I don’t think recursion is that hard to reason about. You need an understanding of how to work with it. This requires practice in the same way dealing with trigonometry required that.

If you are a programmer and feel that dealing with recursion is hard I think you’ve got an opportunity for growth there.

It’s true that recursion is harder to deal with than loops. I generally use loops and recursion for a different class of problems.

Working with trees of arbitrary depth is much easier when using recursion.

Unless you are working in a functional language and don't have loops.
Was fully expecting this PDF to be a one-line reference to itself.
What is the name of the actual book?
The Recursive Mind by Michael C. Corballis.