Object Oriented Programming

Object Oriented Programming

Object Orient Programming (OOP) is an approach to programming (paradigm)
The approach mimics the world we live in.                                                               
In our world we interact with objects, and perform actions onto them.          
We may have a car, and we may want to unlock the car, or start the car.       

This is how we naturally interact with things.                                                            It is the way we already think, and as such it is a great way to program.                                                            

Before we get serious, let’s start with a whimsical story…
________________________________________________________________________

Originally there was nothing,
            without data variations no program could exist.
            However, something infinitely simply was introduced,
            but from it would come the potential for something infinitely complex…
anything… everything.

Binary, it seems so simple… and it is.
But, by allowing a difference, a variance… suddenly so much more is possible.

Perhaps like some digital big bang, a Codedverse was born.
Suddenly mere symbols… instructions… code… could become things.
From that the perfect program was designed for the society to live within.

But, there was a problem.
The society that tried to describe the perfect program did not really know what perfect was…
Suddenly a program which seemed great had a sort of crime appear.
These bugs were wreaking havoc on the perfect functionality of the program

To help fix things,

A team of exterminators got on the scene!
…but, it seemed as fast as they could remove the bugs that more would appear.

It was not until unexpected insight appeared, which lead to a transformation in the Codedverse.

The wisdom was a simple observation…
These bugs are symptoms of the imperfect design of the program that their society created.

The bugs only looked like ‘objects\things’ which were separate from the program.
This realization helped restore clarity… that all these things… all these objects… all these bugs…
are code or code byproducts… which is to say communication, and stored description.

Object Oriented Programming is like Magical Alchemy.
Words becomes Things… Objects.
Gradually becoming more and more complex,
until we have the coded universe.
________________________________________________________________________


… As we shift back from the fantasy back to reality,
let’s take a moment pause in the year 1999.
As we arrive, we find ourselves in a Famous Players movie theater.

The movie The Matrix is playing… lets watch

*        Cuts to a Scene already in progress        *

Cypher: I don’t even see the code anymore… I just see blonde, brunette, redhead.
______________________________________
The statement is still important though.
It is important because when we use our computer,
we also do this.

In reality, we are looking at a series of pixels.  
            I won’t get too off topic into perceptual psychology…
            However, even color is code, it is our brains representation of
            electromagnetic vibrations. However, our user interface to that is the
            experience of color. This is also true with pitch perception…
                  however, for more information on
                  that topic please subscribe to my psychology channel.
           
            We are just so sophisticated at recognizing patterns we do not really think of it as code anymore. We do it so easily even pausing to recognize this can be challenging. Now it is clearly a button… a tab, a date edit… but, really it is active code.

Simply put…
                         we don’t even see the code anymore,
                                    we just see Button, XtraRichEdit, Label.

All these things are just code, that is to say they are description.
All these objects are just from the illusion of code in motion.

All the components we use to create our program is just others code.
From Words to Things, that is the magic of Object-Oriented Programming.

Now to get serious,
there are other approaches to programming, such as ones which focus on the procedure or function of the program,
but Object-Oriented Programing gives us a way to write like the world appears, and it focuses on being concise and not repeating yourself.
Once you make something once, re-use it!
If you already made the Wheel class… use it in the Car class, don’t redesign the wheel!

Write the recipe to make the things, and then reuse those things.
While I have already mentioned inheritance, these are the big pillars of object-oriented programming.                As such these will be the next topics:

                        Encapsulation, Abstraction, Inheritance, and Polymorphism.

1 Comment

Leave a comment