Thursday 23 January 2014

Week 3: Object-Oriented Programming

Up to now, 3 weeks have already slipped away unknowingly and a quarter of this semester just passed! But still, there's a long way to go. In the past 3 weeks, I was exposed to the idea of Object-Oriented Programming. As far as I am concerned, OOP is a really human-friendly way to convert real world objects to abstract data types. The concept of every object having their own attributes and methods is really natural for me, and I think, for most of you. But it was not always plain sailing, I found myself confused when first introduced to the term, 'inheritance'.  Once we declare a subclass,  it automatically inherits all the attributes and methods from the parent class. I do know how to modify or extend the code, but what if I want to cut off some attributes? For example, self.attribute = None? Hopefully, I can figure out this problem as I continue studying on Object-Oriented Programming. Last but not least, I also need your kind response!