Terry Reedy wrote: > But that, I admit, would be an invalid conclusion. And that, I claim, is > also invalid when 'iteration' and 'recursion' are reversed, no matter how > often repeated in texts and articles. The difference is between the > algorithms, not the differing syntactic expressions thereof.
There is a comparison in there about iteration vs. recursion, but it's probably not the one intended. The algorithm one uses sometimes depends quite heavily on which mindset you're using. Some algorithms require much more mental effort to understand when in their recursive form versus the iterative form, and vice versa. If you're stuck thinking in only one form, you might miss the better algorithm because it is not as "simple" in that form. The ideal case would be a programming language that allows you to write the algorithm in whatever form is simplest/most comfortable, and then automagically transforms it to the form that works the fastest under the hood. -- http://mail.python.org/mailman/listinfo/python-list