Thursday, 30 January 2014

Week 4 - Inheritance and Analyzing Recursion

Inheritance is the process by which data can be shared between classes or objects in such a manner that the "child" class or object inherits the methods and attributes of the "parent" class while retaining the ability to have specific methods of its own. This is especially useful in handling errors, as in exercise 2, where any custom errors can simply inherit the data of superclass exception.

So this was introduction to recursion week, a new topic for me. It did not really feel that way though, the tracing we did in lecture was fairly straight forward and seemed to be more just common sense than something that involves a great deal of thinking. That being said, it is worth noting that the recursive formula that was used in the end looked completely mystifying on first glance. I think that the lectures on nested list depth would have been better if we spent less time tracing through the lists and more time on developing the recursive formula.

All in all, a really good week. My favourite part of it was definitely the code for tree burst that we analyzed, as I found it to be simple to understand. The logic of how the code called itself was very obvious and made it easy to predict how the next stage should look like. As well as the fact that the patterns it produced looked amazing on higher values of level!

No comments:

Post a Comment