Tuesday, January 21, 2014

Week 3 - Object Oriented Programming

                   This week in CSC148 we tackled a new programming paradigm called OOP, short for Object-Oriented programming. This programming model introduces many new topics such as inheritance, various levels of abstraction, and improved ways of handling errors. Take for instance running out of space in a stack, with procedural programming we would return -1 to notify the user of popping from an empty stack, but with OOP comes a technique called exception handling in which we can halt a program and relay more specific information to the user about the error they committed. This is one of the many important aspects of OOP which will prove its usefulness in large scale code.

                   Re-usability is a key component to the three central characteristics of a programmer, specifically being laziness. In order to fully captivate this core characteristic, we must first learn of shortening code which we've already seen through the use of functions and procedures. With OOP the whole point is to create a blueprint for which we can build more specific objects based off of it. If we want to create a volvo volkswagon and a dodge caravan, both these objects are called vehicles from which we derive their specific attributes belonging to each. Instead of having to redefine the engine, steering wheel and other attributes among all vehicles, we can inherit these general characteristics, and tweak them however we please! Who would want an engine in a volkswagon that's also in a dodge caravan? That would make for awfully terrible gas mileage as well as horsepower loss.

                   This is just the tip of the iceberg in Object-Oriented programming design, I'm sure more will be understood later on in the course, for which I am looking forward too.

No comments:

Post a Comment