On Monday, November 3, 2003, at 03:43 AM, Rob Dixon wrote:

Recursion can always be eliminated by hard-coding the stacking of
context variables that the compiler provides and using a loop
instead of a recursive call. In fact this is exactly what File::Find
itself does. But recursive code will almost always allow a better
expression of an algorithm than the hammer and nails technique.

For some definition of "better" meaning "easier to understand", but certainly not "faster", right? ;)


I agree with Rob that recursion is usually prettier. It has very real limits though, that iteration can often extend greatly. Also, if you're ever looking for more speed, start with unrolling recursions, trust me.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to