From: Nat Pryce Date: 2001-09-22T09:25:50+09:00 Subject: [ruby-talk:21509] Re: SV: Re: Ruby/objects book in style of The Little Lisper From: "Kevin Smith" > --- Mikkel Damsgaard wrote: > > Hey! Ruby is proper tail recursive, so since the > > recursive factorial is much easier to understand > Sorry, I disagree. Recursion is "cool", but is rarely > simpler to understand. Especially for non-technical folks. That very much depends on the problem. If traversing linear structures or implementing linear algorithms, iteration is just as natural as recursion, and is more natural for people from a non-mathematical background. But when writing code to traverse tree or graph structured data, recursion is the only way to write algorithms -- iterative algorithms basically reimplement the data structures that are used by the compiler to implement recursion, but with more complex code. A good grounding in simpler recursive algorithms will help one solve these kind of problems.