Thursday, February 5, 2015

Thoughts on tracing recursion

Recursion has indeed gotten easier and the main things that helped with this were,  I think, the exercise sheets. Those sheets gave me the practice I needed to be confident in my understanding of recursion on the test. Tracing recursive functions on that lab and exercise sheet REALLY helped me understand how they work, to the point that when studying for the test I wrote several recursive functions with relatively little difficulty (only to then go on Piazza and realize we didn't need to write recursive code for the test, but ah well, for some odd reason I feel like that will come in handy anyways... I wonder why that could be...). The tracing allowed me to stop seeing recursion as this great big scary computer programming concept which people who had learned previously had told me was very hard to get right, and instead view it in a mathematical way. This not only made it less intimidating to approach, but made it very easy to see how a recursive function 'unravels', so to speak. Tracing recursion before actually writing recursive code is going to help me actually understand the nitty-gritty of how it works rather than knowing how to implement in an 'I-just-memorized-this-formula' sort of way. Debugging when writing future recursive code will be infinitely easier because of this, as will writing more complicated recursive functions. In short, the number of functions we had to trace was a huge help.  At this point in the course I actually like recursion (something that terrified me a bit a week ago) better than classes and inheritance (not that I don't like those - I do - I just find recursion more satisfying). I may live to rue these words when we get into more complicated recursion (I'm going to go knock on wood now) but for now I will enjoy this strange and lovely feeling of having a handle on what is going on.


2 comments:

  1. Haha Your writing style is pretty cool and its not boring to read (like some of the other I've read ! ) dunno how you like recursion though ..

    ReplyDelete
  2. Haha Your writing style is pretty cool and its not boring to read (like some of the other I've read ! ) dunno how you like recursion though ..

    ReplyDelete