Tuesday, January 21, 2014

Object Oriented Programming

     One marked difference from CSC108, is that CSC148 is primarily interested in Python's Object Oriented Programming(OOP) abilities. An object is an instantiation of a class. For example, the object 3 is belongs to the class int. Python is an OOP language so it only makes sense to utilize this languages functionality to create new classes and manipulate their instantiated objects. In CSC108 we would use Python's built in modules containing classes such as int, list, float and dict. However, using only these classes might limit what we can do in a program; so creating our own class gives the programmer more freedom for implementation.

    Personally, I find the concept of classes and objects fascinating. One analogy I thought of is our mental faculty of concepts and categorization. Like classes in CS to categorize some object x, we think of it as an instance of a category, a class of objects that belong together - a concept. Coming from Cognitive Science I understand the interdisciplinary importance of Computer Science. First, to understand the mind processes through artificial intelligence and neural networks. Second, to create programs for accurate and precise methodology for studies, with little room for human error.

    Perhaps I'm digressing. More concretely, I found the basics of a class to be more challenging to understand than say, other properties of a class like inheritance. Inheritance makes sense to me in that methods used from a master class can be used in subordinate classes. But, self for example took me some time fully grasp. Actually creating an object from a class and manipulating it was more challenging than the theoretical aspects of a class. Using self in class methods using self in the shell proved to be difficult. Perhaps I think less obsessivily about what actually happens and just learn through repetition