|
|
|
|
|
by hliyan
4069 days ago
|
|
It's the most optimal if readability is the goal, but not if reliability is the goal. Programmers often assume ideal interpreters/compilers and runtime environments. This is often not the reality, especially as the environment gets closer to hardware. Recursive implementations in particular can more easily expose peculiarities in the stack implementation, yes? |
|
That said, writing code that fits the construction of the language is probably more useful than siding between "loops or recursion". If I'm writing Scala, my code is usually chock-full-of-recursion. If I'm writing C, not really as much, because I'm thinking "which bits go into which memory". With Python I tend to think in terms of list comprehensions, etc.