I’ve been reading Eric Lippert’s series on recursion. Its actually quite interesting and I especially loved his general definition for recursive algorithms.

That’s what recursive programming is all about. All recursive functions follow the same basic pattern:

  • Am I in the base class? If so, return the easy solution.
  • Otherwise, figure out some way to make the problem closer to the base case and solve the problem.

I think I would use recursive algorithms more if I could get past the potential stack problems, and the reality is that most of the time it wouldn’t be a problem anyway. Post on Eric!