kyrie at uh.cu
Tue May 5 08:57:17 EDT 2009
On Tuesday 05 May 2009 04:25:49 am Carl Banks wrote:
> Iteration should be used instead of recursion anywhere a tail-
> recursive algorithm is possible. Recursion should be used only when
> tail-recursion is not possible.
Is it because most languages suck at recursion (specially python, as this
thread shows)? If that's the reason, I think you have it backwards... Turning
a tail-recursion into an iteration should be the compiler's job, not mine.
An algorithm, any algorithm, should be written in the way that is easier to
read, unless the language wont allow that easier implementation to be
Programming languages suck, but that shouldn't mean that we can't hope to
Luis Zarrabeitia (aka Kyrie)
Fac. de Matemática y Computación, UH.
More information about the Python-list