Thursday, January 23, 2014

Object-Oriented Programming

Lectures and Miscellaneous
    Object-Oriented programming is a section of computer science which contains extremely useful tools to organize, schedule and assess whatever the programmer/user wishes to work with.
Throughout this week I have learnt how one may derive and create his/her own parameters and rules for a type that they want to create.
    Furthermore, learning that programmers are able to create a Superclass from which they may create subclasses, opened up an entire new horizon and aspect of OOP that I did not know.  This allows me to only imagine how much can be done with OOP and how useful it can be for any organization when it wants to set up a database which will be able to count, and recount all the different elements that that organization contains.

    A technical aspect that I discovered this week was the fact that in a function defined with a class, if one wishes to call the function within its own body, there have to be default values for that same function in order for it to function.

Tutorial
    In order to remove the first element in a list until the list is empty, while maintaining a constant running time (not dependent on the size of the list) my partner and I discovered the function popleft(), and finished the lab within 1/3 of the time allocated for it. However, the T.A. asked us to review our function and try to do it a different way. Our solution allowed me to view lists from a different perspective: one where you don't have to change the actual list in order for a specific item to be acknowledged as the first one, you can do that solely by tweaking with the indices of the different elements inside the list.
    In the tutorial this week, I learned that even though it is always useful to be lazy (while still efficient and correct) while programming, sometimes in order to learn new skills or understand the material better, one may wish to go through a "little less lazy" way.


No comments:

Post a Comment