You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: