Language for the ages

Sridhar Ayengar ploopster at gmail.com
Thu Oct 20 14:34:22 CDT 2005


Sean 'Captain Napalm' Conner wrote:
> It was thus said that the Great John R. Hogerhuis once stated:
> 
>>A recursive algorithm can be quite elegant and easier to understand in a
>>limited, useless educational example. But once you start adding all the
>>little bells and whistles (like, say, exception handling) it quickly
>>becomes a hairy mess.
> 
> 
>   I used to think that recursion was useless, due to the examples given in
> school, like multiplication, the Fibonacci sequence or the Towers of Hanoi,
> but in the past few years, I've found a few places (only a few) where it
> does lead to a clean implementation, usually dealing with tree-structured
> data, like a file system:

Recursion makes a lot of sorting/searching algorithms much cleaner too.

Plus, IMHO the recursive factorial (x!) algorithm looks a lot less 
complicated.

Peace...  Sridhar



More information about the cctalk mailing list