Object Oriented Programming Part 1

Considering the fact that Object Oriented Programming is a common approach that people have utilized for software development over decades now; very few among us do actually understand the use and the philosophy behind it.

Now you will be thinking… Wow! here is another claim that I have understood the topic most. So if you think that it will be a lot better to leave this topic and utilize your time in a better way; However if you are beginner or just want to refresh your concepts, this Blog is for you.

Out of many definitions of OOP one of them is to program real-world objects, to provide the a facade to the reality of this world….. oops…….. have I lost you.

Ok. Lets get real… Have you seen The Matrix!!! The character Neo wakes up from machine world into real world which have been taken over by the machines. Now think a human.. they very first human who tried to tell a machine that “THIS IS A CHAIR”.

Now how can you identify a chair. Chair will only be identified by its characteristics which are physical in nature. Like it is made of Wood, it has legs and a back, Colour of wood is dark brown etc. This is we can call PHYSICAL CHARACTERS. You must be thinking what the hell I am talking about.. Trust me we will hit Computing hard with the same chair 🙂

On the same pattern we utilize this chair for some work. Common sense says sitting… Although trust me its uses are much more than that.

So there are two aspects of it, PHYSICAL PROPERTIES & UTILIZATION.

Loosely translated into a computing world

Physical Properties = Data
Utilization = Function

So to tell any dumb machine that this is a stupid chair, I can tell two basic things

1. What is its Data

2. What is its Utilization

Now if we replace the word its with OBJECT, we are talking Object Oriented Programming.

Going back to Matrix.. first thing you have to tell any Agent is that what every Object is like and what it does. So the basic means of doing that is called Object Orient Programming.

If you are good till this point continue reading… else !!!!!!!!!!!!

class Chair
{

Data: Height, Length, Colour, Weight

Functions: Used for sitting, Can be Used for Hitting as well.

}

So to tell this to a dumb machine we used classes and objects, although both have a slightly different meaning.

Every thing on this earth you see shall have DATA and a FUNCTION. Once you know what it is and you want to give machine that wisdom, the mechanism you will take is called Object Oriented Programming.

so Neo get ready to fly, we will cover more later.