Sunday 3 November 2013

A Love Letter To Recursion

I know I just recently talked about recursion in a post, but I have heard too many complaints about recursion lately to not address it.
I understand that loops are a comfort zone, but that doesn't always make them the easiest way to solve a problem.  I will admit it takes a while to get use to the way to think for recursion, but once you get it, it brakes down problems really easily and clearly. During the lab last week, the last question was solving the first question without recursion. With loops it took me an hour and a lot of lines of code, whereas the recursive algorithm took me under 15 minutes and only a few lines.

Dear Recursion,
Let the haters loop. They are just stubborn in their coding practices. If they just got to know you, they would love you like I do. You run so elegantly and are truly beautiful. You do so much with so little, it's amazing. The base case for my love will always return true for you.