Sunday, 25 January 2015

sLog 6: object oriented programming

The first few weeks of csc148 were good review. However, I was also introduced to a new concept: Object Oriented Programming. In the past, I have only thought of programs as simple machines that takes in input and spits out something else. Object Oriented Programming is exactly what it sounds like: you use code to create "objects."These objects contain characteristics that are executed by functions. It may only seem like a way to organize code, but it operates with efficiency far beyond that.

An example of such is a game, such as subtract square that our group has already been working on. a super class is a game object (almost like a game console, even though i have never owned one) is a platform which the game operates on. The platform contains atributes which the game operates on. The game itself, Subtract Square, is a module that is attached onto the superclass (the "platform"). Attributes that are common across every "game" (such as: the turn, the score, the game over state) are embedded in the super class (platform) and inherited to every game (module).

Even though not thoroughly covered in class, my curiosity has led to the "why's" of OOP via. google, and there are a few which i found profound:
1. Code reuse. example: since every game has almost the same characteristics, the platform can have multiple games attached to it.
2. Encapsulation (csc207 concept). Hiding code from the next software engineer so that they are not tampering with things that might cause problems. Useful when working in teams.

I believe in education. However, I want to also believe that the techniques I am learning in "practical" courses can be applied within the industry.
In brief, Object Oriented Programming has been taught to me in such a way that i am beginning to understand software development process. It is a concept that I am currently learning to apply in my assignments and I believe will be here for the next few decades.

No comments:

Post a Comment