Sunday, February 16, 2014

Week 5: stools, names, tracing

In week 5 of CSC148, we started this week's material by talking about the concept of "recursive insight". The idea behind recursive insight is to develop an understanding of what our problem is, spot out any patterns, and then figure out how we can break down the problem into subproblems, such that we can develop an recursive solution to solve it.

The Recursive Way...
I found this method of problem solving to be a nice way of figuring out how to develop a recursive solution. In a typical CS fashion, the steps for developing a recursive insight is structured into an algorithm, such that, we as the programmer, can easily spot out when a recursive solution would come in handy when given a programming problem. There is one thing that I would of probably added to the lesson though, and that was the necessity of developing good base cases when creating a recursive function. I found that most of time, when I'm talking to classmates about the use of recursion in programming, many fail to realize how important base cases are in developing a recursive function. 

Tracing
We also covered the topic of tracing a little bit more since last class, which I won't talk about in great detail since I had already blogged about it in my last post. Nevertheless, it doesn't hurt to say that knowing how to trace a program, both mentally and on paper, is a necessary skill in becoming a good programmer. Sometimes its more important to understand how and why a function works than to be simply content with having a working function. This is important because there often come times as a developer when it may become necessary to modify a function to do something different to what the function was initially programmed for, as is often the case in the software development world.

Thoughts or comments for the day?
To fellow CSC148 students: what are your thoughts on recursion? We've definitely have talked about this concept for quite a few times now at this point. What are your thoughts on it? Does it make sense? Leave your comments below!

Also, please let me know if there's something you think I could do to improve this blog; would love to hear some feedback. Thanks.

No comments:

Post a Comment