Why Object Oriented Programming Makes Sense?
By: Hermawih Hasan
A boy was sitting there for about an hour trying to
memorize a school task which has exactly one long sentence,
ninety five words, or five hundreds and twenty three letters. The boy who was on the third grade in a primary school
could not stand it anymore. It was obvious that the boy
could not handle it. Out of desperation, he was crying so
loud that his father finally decided to help him.
His father took him to another room and tried to calm him
down. After the boy stopped crying, his father drew eight
symbols and mapped for each symbols to some words on that
sentence. It was like magic, the boy could memorize that
sentence in just about ten minutes.
I do not have any scientific explanation of how our brain
work but I knew that our brains need something to associate
one thing with other things; the exact word probably is
encapsulation. I will give definition of "encapsulate" from
Oxford Advanced Learner’s Dictionary: "to express the most
important parts of something in a few words, a small space
or a single object." If you have noticed, I also deliberately wrote the amount of
letters of those words. Suppose that you must memorize that
entire letters by combining all the words into only one
word, could somebody be able to memorize that word? It is
difficult thing to do. But by separating 523 letters into 95
words that have meanings, the task seems easier to do. By
logically mapping 95 words into only 8 symbols, the task is
surely a lot easier. You see that the word encapsulation can
be applied not only to object oriented programming (OOP) but
also to memorizing, learning, or studying. For experimentation, could you spell this word,
iamgoingtobedearlybecauseimustgetupearlyinthemorning? Now
try to break up that word into some words: I am going to bed
early because I must get up early in the morning. After the incident, one day an idea come to me of how the
above story related to OOP. Why OOP makes sense? With the
help of only eight symbols, the boy could memorize ninety
five words. So it was about one symbol representing twelve
words. In OOP, object has methods, properties, and events.
If I asked a nine years boy: what a bicycle does or what
properties a bicycle has, I think the boy could answer it
correctly. One word of bicycle could encapsulate many things
of what a bicycle does and many things of what its
properties. Several years ago, I read a book about
"Extreme Programming". After reading the book I was not
convinced of that methodology. However after reading a book
from Dr. David West, Object Thinking, Microsoft Press, and
then I think "Extreme Programming" practices can also be
applied to a software development. What made me change my
point of view? Dr. West said in his book on Page 28: "Object thinking is central to extreme thinking. This is
true even though there is little explicit mention of objects
in the XP books. Object thinking is so basic to XP that it
is simply assumed." By the way, the above story of a boy is a true story because
the boy is my son who is now on the fourth grade of a
primary school. |