+ 10
Iteration or recursion. What is your favorite? In which cases? And why?
3 Antworten
+ 23
When both options are available I personally prefer loops. they are easier to understand and implement.(codes with loops are more readable)
And I hate it when recursive functions sometimes result in "StackOverflow" for big arguments.
+ 7
depends on language efficiency
in js for ex recursion is more inefficiet than loops
also recursion might be easier to use than loops
but whatever you can do with recursion you can do with loops
+ 1
depends on efficenty. I like to use iterations for for loops.