Recursive calls and stack space

Miscellaneous Forums/General Discussion/Recursive calls and stack space

> Is there a pre-defined limit on how many times a function can call itself before running out of stack space

Recursion sounds great, but every time I've tried to use it on a real world problem it never works due to stack space. So the limit seems to be "if you are trying to solve a real world problem then you will run out of stack space". I wish I were joking but it's the truth.

Instead of recursion it's always been more reliable to create a list, queue, etc... and fill it with an algorithm that simulates recursion. There is a floodfill example in the code archives that does this, I don't remember which one though.