News for hackers. Stuff that matters.
Re:What Is Recursion? [pdf] by Koshkin on Monday March 13, 2023 @12:48PM (#35138379)
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.
Re:What Is Recursion? [pdf] by nh23423fefe on Monday March 13, 2023 @03:24PM (#35141074)
What makes a case complex?
Re:What Is Recursion? [pdf] by Koshkin on Monday March 13, 2023 @05:34PM (#35143124)
An indirect recursion.
Re:What Is Recursion? [pdf] by IIAOPSW on Monday March 13, 2023 @05:48PM (#35143345)
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.
Re:What Is Recursion? [pdf] by kian on Monday March 13, 2023 @09:35PM (#35146134)
Honestly, this is the best single-line definition for a non-specialist I have ever seen.
Re:What Is Recursion? [pdf] by IIAOPSW on Monday March 13, 2023 @10:05PM (#35146391)
How many single line definitions for non-specialists have you seen?
Re:What Is Recursion? [pdf] by kian on Monday March 13, 2023 @10:19PM (#35146504)
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.

Re:What Is Recursion? [pdf] by IIAOPSW on Monday March 13, 2023 @10:50PM (#35146762)
Please, credit it to Euler.
Re:What Is Recursion? [pdf] by stev-0 on Tuesday March 14, 2023 @02:38AM (#35148100)
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.

Re:What Is Recursion? [pdf] by schwartzworld on Tuesday March 14, 2023 @02:27PM (#35156240)
Unless you are working in a functional language and don't have loops.