Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precision about recursion #15

Open
busybox11 opened this issue Mar 29, 2023 · 0 comments
Open

Precision about recursion #15

busybox11 opened this issue Mar 29, 2023 · 0 comments

Comments

@busybox11
Copy link

Hi,
I just stumbled upon this repo (somehow) and something tickled me while looking at the limitations table for recursion.

Sure, you might not need a for loop when recursion can do the trick better / in a more convenient manner, but it does (usually) have one limitation that for loops never have: execution limits.

For instance, Python has a max recursion depth of 1000. Yes you can change it, there's usually a simple way to do it in most languages - but still, it's a limitation that should be considered in some cases.

Don't get me wrong, you should absolutely optimize your algorithm in order not to create another problem like this one.
Let's say, you have an algorithm that scales exponentially and you didn't consider it before, it might sound fine at first but as time goes by, you could hit this limit faster without even noticing.

I'm wondering if you think it would be relevant to add it to the table.
It might not be the most useful thing to add to this doc, but it could be a nice to have. I'm not sure haha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant