unflinching idealism ... since 1997 archivessitemapabouthelpfeedback
ideas, identities and interactions
  • Home
  • InFocus
  • Themes
  • Columns
  • Articles
  • Fiction
  • iLogs
  • Gallery
  • Unplugged
  • Writers
  • Interactors
  • Tags
Sign in | Join Chowk
web chowk
  • Article
  • Interact
  • read write comments
  • add to favorites
  • get rss feeds
  • print
  • email this link

Living in an Object Oriented World

Humayun Ahmed September 5, 2001

Tags:

He said, “When the programmer has an objective in his mind, while coding a function, the program he is writing will be an Object Oriented Program and this kind of programming is known as Object Oriented Programming”



I once interviewed a Computer Science graduate from a known university of Lahore, Pakistan. Since most of the projects going on in our company at that time were either in C++ or
in Java, so questions about Object Oriented Design and Development were one of our favorites.

This person, along with many other interesting answers, described Object Oriented Programming in a very worldly definition. He said, “When the programmer has an objective in his mind, while coding a function, the program he is writing will be an Object Oriented Program and this kind of programming is known as Object Oriented Programming”

I felt an immediate urge to laugh out loud, but could not do that. To divert my own attention from this answer, I tried couple of other areas. Unfortunately, he was prepared to answer all areas with similar logic.

I was a strong believer in the power of Object Oriented Design and Development, and often I used to think what would happen if this whole world is Object Oriented. Having been through this interview, I thought that my struggle to think of this world, as Object Oriented will lead me to the same conclusion as described by that person. But no, we can still live our life in an Object Oriented fashion, given that each person, with whom we interact, lives that way too.

Consider a program in which everything is functional. You have procedures for everything. In a way, each function does some of its work and for some specialized tasks, depends on other functions. There is no strict rule about how much functionality can be put into a function. If you put one Object into such a program, it may die due to loneliness. The functions would help each other for different tasks and no one would help this poor object. Instead, they would say, “go and sort your list yourself, aren’t you object oriented” while the functions will help each other. If some function is too rude, it can even say “If you don’t know how to do it, why don’t you ask your parent, your parent musk know how to do this”

In short, it will be a big mess.

This is what happens when programmers start implementing an Object Oriented program and end up writing global functions for everything. While working in Smalltalk, a known Object Oriented language, I came to know that biggest crime in Smalltalk programming is to define a global variable whereas in amateur programming most commonly used thing are global variables and functions.

Think about the concept of virtual functions. In our life it means, that if someone asks your father something about you, and you haven’t told your father that you can do this, his answer would be in negative. In programming this would cause a linker error. In your world, the problem is, you don’t tell everything you do to your father. There are some specialized functions that you perform only if someone asks you personally, not by a reference from your father.

We can still say that this is also OK so far. Some of my methods are just for my friends and me, it doesn’t matter if I ask my father to give me a virtual interface for them. But be careful, if your friend asks you a favor and you don’t have that method implemented and can’t help him, the call will end up on your father’s desk. You can’t run now. Your father knows what kind of calls do you get from your friends. There is no running away from this situation. You will be grounded.

May be other features are not so bad in real life. Let’s take overloading. You have different behavior for same method depending upon who is asking. If a friend of yours asks o help him in studies, you agree very willfully. Some days later another friend asks you, may be you will refuse or show him slightly different behavior depending on what he offers you in parameters.

Consider just for a moment, if these two friends of yours are talking to each other and accidentally talk about your help in studies and compare your behavior in each case, your friendship with one of them, may be both of them will be ruined. They will call you double-faced. It turns out that overloading is not successful either in real life.

In a way Object Oriented technology is very racist. It keeps all the races away from each other. If there is a room, it is either only for Punjabi people or only from Sindhi people. A Pathan cannot go into the same toilet as a Baloch. In front of a bank for paying utility bills, there are different lines for each kind of people.

This is so because in this Object Oriented world, a line doesn’t know how to treat different kind of people. “This is not my problem”, you would say, “use templates” but that will not serve the purpose either. This division of races is a very broad view. The Object Oriented technology even breaks people up in each type very minutely. You can only mix with other if you are same type. You cannot get into a line where your father is standing, unless both of you are same types. You would say “Why does it matter if he is long and I am short, I’ll grow someday”.

No, the technology will not let you stand with them in line that is unless, you bring a reference from your father. But again, then you will be thrown into a line of people all with references from their parents. Again, parents of all these people must be from one grand-grand-…-grandfather. Would you like to live in such a racist world?

These are just a few examples to tell you why we cannot live in an Object Oriented world. If you don’t want to be double-faced or racist or if you don’t want to be grounded, don’t try to make this world Object Oriented. But the question still remains “Do we still have objectives in our minds even if we don’t live in an Object Oriented world?”
The author lives and works in California and is a software engineer from Lahore.

Times viewed:6750   interact interact   read comments read comments 63

Share and save this article:

Similar Articles

  • Dr Afia Siddiqui's Case Muhammad sadiq
  • It's A Deal After All! Dost Mittar
  • Is Mumbai a hub of dirty politics? aditya uppal
  • Honor Killings in Babakot kashkin dabruski
  • Greek Tragedy Emma Alam
more »

US Elections 2008 Primaries

  • Hillary Clinton a Better Presidential Candidate
  • Leaders, Heroes and Mountains
  • Dr. Martin Luther King Jr. and New American Dreams
  • Pakistan Elections 2008 - An analysis
  • Political Issues Ahead of Pakistan Elections
more »
get rss feed Get Chowk RSS Feed

Get Chowk Newsletter

THEMES

  • Pakistan's Struggle for Democracy
  • The Indian Story
  • Indo-Pak Relations
  • Personal Narratives
  • Religion Today
  • War on Terror
  • Role of Media
  • Call for Social Change
  • Hold Them Accountable
  • Environment and Us
  • Way of Life
more »

Latest Interacts

  • jayp: Arjun 137, It was very... US Commando Strike in
  • akcheema: Re: # 15; rabia the... Honor Killings in Babakot
  • majumdar: Masadi sahib, through land reform... There is no ‘honour’
  • satya100: No takers for Shantic... Faith and Religion
  • satya100: "The district committee of... Faith and Religion
  • hamzaad: masadi, some spineless excuse for... There is no ‘honour’
  • satya100: It was not Maoist... Faith and Religion
  • satya100: B.RAMAN Every Indian, who wishes... Faith and Religion

Write on Chowk Interact Guidelines Privacy policy Terms Contact

Copyright © 1997 - 2008 chowk.com. All Rights Reserved
Reproduction of material on any www.chowk.com pages without prior written permissions is strictly prohibited