performance - Why should recursion be preferred over iteration? -
The change is more demonstrative than recurring, right? Then some people believe that why is that recurring better called (more beautiful in their words) than recurrence? I do not really see why repetition is not allowed in some languages like Haskell and recycling is not encouraged. Is it not absurd to encourage a bad performer (and even when the higher performing option is available for i.e. recursion)? Please put some light on this thanks.
The change is more demonstrative than recurring, is not it?
Not necessarily this concept comes from languages like many, where a function is calling, recursive or not, there was a large overhead and a new stack frame was created for each call.
This is not the case for many languages, and recursion equally or more demonstrators with a recurring version. These days, some compilers repeat some recursive constructions in the revised version, or reuse the stack frame for tail recursive calls.
Comments
Post a Comment