4 ms·
Don't fall into the Turing equivalence tarpit. It's indeed possible to rewrite recursive code in terms of iteration and vice versa, but the most natural expres
by chromatic 17y ago
Don't fall into the Turing equivalence tarpit. It's indeed possible to rewrite recursive code in terms of iteration and vice versa, but the most natural expression of many algorithms is recursion. If you can convince the compiler and/or runtime to manage your stack for you, you can concentrate on the interesting parts of the algorithm.
It's like the difference between using objects in Smalltalk and writing your own object system in C.