Answer the question
In order to leave comments, you need to log in
What is your take on recursion?
Somewhere around 5 years ago, I had a dubious opinion about recursions.
However, there has been a growing need for them lately.
For example, if you have an ar-object with many relations in 3 or 4 nestings and there is a task to wrap this whole thing in collections. That is to wrap each record of nested relations in collections.
This is where recursion comes into play. Will its use be justified here and is there any point in using them or avoiding them anyway?
Answer the question
In order to leave comments, you need to log in
Recursion is a great solution for single tasks. Same as using case instead of if, or using sql instead of data arrays.
Just use them where recursion works better than other solutions and that's it. There are many tasks where recursion would be best practice.
As for the fact that "it doesn't work well in some languages", you won't know until you try it.
What is your take on the freezer? Somewhere about 5 years ago there was a dubious opinion, but now I buy dumplings more and more often and they need to be stored somewhere.
In short, the question is crazy. If recursion makes it easier for you to solve a problem, feel free to use it.
Recursion is a beautiful evil. It's best to avoid it, but sometimes you can.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question