Thursday, 12 February 2015

Week 5: Tracing Recursion

Recursion, my old friend. How nice it is to see you again.

To be completely honest, recursion is one of the reasons that I love computer science so much. Though it can be tricky to learn and a bit of a headache to trace, especially if what the program is supposed to do isn't given, well-written recursive code has a unique finesse. I see certain recursive solutions to problems as works of art. I think the way they can simultaneously begin, go through, and finish problems by utilizing copies of themselves is kind of beautiful. 

With that said, this week put emphasis on what a headache it can be to trace memory going in and out of recursive functions and methods. Fortunately, mostly due to having some experience dealing with it from high school, the examples of tracing we've been given in class haven't been too tricky. As such, it falls into the little oddball category of schoolwork alongside 11th grade trig identities in math and 12th grade Hess's law problems in chemistry; puzzles that are weirdly kind of fun to do. I have a feeling that the recursion traces to come later in the semester are going to have me pulling my hair out, but the tracing I've done this week has kind of felt like solving puzzles. Not that I'm always doing them in my spare time, but it's been a pleasant re-introduction into a subject I haven't seen for over a year. In particular, I've found the method of substituting back known cases incredibly helpful in a subject that I had a decent bit of trouble with when it was first introduced to me.

No comments:

Post a Comment