In this week's lab, we focused on class inheritance: we created class Motorized and subclasses Car and Motorcycle. In designing the lab's classes and subclasses, I was particularly interested in the manipulatability and reproducibility of classes via subclasses.
The natural world is defined by scarcity of all material objects. This idea is what allows the laws of supply and demand to function. But, can the same be said of immaterial properties, such as ideas? Surely human thought as an abstract concept is something every human being can enjoy endlessly, within the span of his or her life. Moreover, human thought can be reproduced via teaching; if I have a unique thought, I can share it with other individuals, so that we all possess that thought. Unlike material goods, conveying a thought does not involve a forfeiting of it, as would be the case in giving a material good to someone. Keeping this idea in mind, I would like to compare Classes to teachers and Subclasses to students. A Class contains a unique, original idea. However, it can share that idea with subclasses without having to give up its original idea. Rather, it disseminates its ideas to multiple subclasses, which can then manipulate this idea, to a point, to perform operations slightly different from those performed by the original class. The parallel between classes and teachers demonstrates one of the merits, as well as dangers, of computer programming: the ability to endlessly reproduce and share information at next to no material cost.
The natural world is defined by scarcity of all material objects. This idea is what allows the laws of supply and demand to function. But, can the same be said of immaterial properties, such as ideas? Surely human thought as an abstract concept is something every human being can enjoy endlessly, within the span of his or her life. Moreover, human thought can be reproduced via teaching; if I have a unique thought, I can share it with other individuals, so that we all possess that thought. Unlike material goods, conveying a thought does not involve a forfeiting of it, as would be the case in giving a material good to someone. Keeping this idea in mind, I would like to compare Classes to teachers and Subclasses to students. A Class contains a unique, original idea. However, it can share that idea with subclasses without having to give up its original idea. Rather, it disseminates its ideas to multiple subclasses, which can then manipulate this idea, to a point, to perform operations slightly different from those performed by the original class. The parallel between classes and teachers demonstrates one of the merits, as well as dangers, of computer programming: the ability to endlessly reproduce and share information at next to no material cost.
For more info on classes and subclasses, you might want to check out Forest Li's post on the topic. He does a great job of explaining the fundamental principles of classes and subclasses. He also takes the time to provide some examples.
Additionally, if you're still interested in exploring the topic of object-oriented programming, I suggest checking out GR's week three post. GR does a great job of explaining the concept technically via Pythonic terms. He/she also provides some useful comparisons for people who are not yet comfortable with technical jargon.
Additionally, if you're still interested in exploring the topic of object-oriented programming, I suggest checking out GR's week three post. GR does a great job of explaining the concept technically via Pythonic terms. He/she also provides some useful comparisons for people who are not yet comfortable with technical jargon.
No comments:
Post a Comment