Monday, 16 February 2015

Week 6: Object-Oriented Programming

***Use this for week 7's summary of OOP***

According to wikipedia, Object-oriented programming(OOP) is a "programming paradigm based on the concept of 'objects', which are data structures that contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods." Object-oriented programming is a deep concept that is hard to explain in just a few sentences. Even after my 2 years of experience with programming, OOP is still a confusing topic to grasp. From what I understand so far, a method is a like a function except that it starts with a class parameter, often called self. A class is like a library which contains different kinds of method to that work together to perform a function that the user wants. 


OOP is a very helpful concept in programming, especially when creating games or client code because we can use inheritance or polymorphism to make code from different classes together.
 
Generally, I can use these concepts to write code but sometime's its hard keeping track of how to access methods from classes that are not the main class. Moreover, this week's lab 5 was difficult for me because I was not sure how Tree.py works. We were given many recursive methods that we were supposed to write but since I didn't even understand how the Tree class divides up the children and groups it into nodes, I was not able to write any of functions. It would have been nice if it was more elaborated upon how descendents_from_list(t, L, arity) grouped nodes during our lecture so that I could do a better job on my lab. I hope that this misunderstanding can be cleared up in the next few lectures after reading week.



No comments:

Post a Comment