Monday, 14 October 2013

Thanksgiving, Turkey Comas, and Object Oriented Programming.

So with all the excitement over being done the assignment and looking forward to a long weekend it seems that I forgot to start writing in this blog.

During the long weekend, I ate way too much sweet potato and entered a sedentary, slug-like state, moving only to raise or fold in the thanksgiving tradition of poker with Grandma. Finally back in Toronto, unpacking the suitcases of clothes I brought home to launder, and preparing to go to the library with a stack of midterm study materials to have a nice nap, I remembered with a start that I had to write a post for the blog about OOP. Oops! So here goes:

Object-oriented programming is a programming paradigm which focuses on bundling together functions, attributes, and methods into objects such as classes. This builds a model in the computer closer to the real-life representation of what is being dealt with than other paradigms such as procedural programming. This allows programmers to think of dealing with these virtual objects as they would ones in the real world, making it simpler and more straightforward to implement new methods and functions within the object or to use the objects in new ways. If, for example, there is an instance of the class 'Car,' then a program need not manually change the attributes of the car to drive to a place; the program can simply call the car's 'drive' method, similar to how a driver does not run time forward, teleport his car to the destination and then adjust the gas and odometer readings to something sensible; he simply puts the car in gear and drives where he wants to go. Treating the car as an object ties all the dials and controls of the car together, making them compose as detailed a model of the car as the program requires, which helps organize a computer scientist's thoughts and analysis of the program, as well as making the code be more comprehensible and easy to modify to other programmers.

No comments:

Post a Comment