Hi all, I am back with my 4th SLOG for this semester. I have to say things are going so fast but as I anticipated in my first slog, its going to be an uphill battle. It sure has been one. With test one, assignment one and a couple of quizes out of the way I feel much confident in my ability to program using python. Today I'll be writing more about what object oriented programming (OOP) actually is. In doing so, I hope that it will aid my understanding of OOP and will fill the gaps (if there are any) for your understanding. Please feel free to correct me and fill in where I am lacking by commenting at the bottom. One of my reasoning in my "Why Geeks should write" slog was that writing helps the writer as much as it helps the reader (if not more) in understanding the topic at hand. With this reasoning in mind I will start by defining what object oriented programming is all about.
Object oriented programming is a programming language model that focusses on 'objects' and data rather than action and logic. In OOP we care about objects to be manipulated rather than the logic behind manipulating them. Some of the basic topics of interest are:
1) Class: A data structure that contains the set of attributes that characterize any object of the class.
2) Subclass: child class.
3) Class variable: A variable that is shared by all instances of a class. it is defined within a class but outside any of the class's methods.
4) Instance variable: A variable defined inside a method that belongs only to the current instance of a class.
5) Inheritance: The transfer of the characteristics of a class to other classes that are derived from it. Subclasses are used for inheritance.
6) Instantiation: the creation of an instance of a class
and much more. While most of this was a review from CSC108, working on the assignment 1, creating classes and subclasses helped me be fluent in creating classes. Initially I was overwhelmed by the amount of things that creating classes require, specially the special methods __str__, __eq__, and __repr__. But now that the assignment is done and the test 1 is over with I am super comfortable with these.
Looking back at the concept of object oriented programming, I can see how one can use this approach to keep track of data. This is extremely helpful to me for the statistics part of my studies. It helps me view material presented in other non-compsi classes as a class having subclasses. It helps me to use the idea of superclass and subclass and methods to summarize material in my other courses in a coherent manner and do a better job and understanding and remembering the material for later one, such as on a test.
I hope this summary has helped you in understanding the object oriented programming concept more and I hope you are able to relate to the idea of how using OOP for summarizing other course materials can help narrow down to the main topics of interest rather than the 'junk' material.
No comments:
Post a Comment