Object Oriented Programming in Quran!

If you are a student or a graduated of Computer Science, you may have or may have had a course called “Object Oriented Programming (OOP)” or “Advanced Programming”. If you’d like to describe what OOP is, what will you say? I personally use this example in my classes:
Assume that today our GOD wants to create a new human. Will He redefine the concept of all properties and operations of human? Will He frequently redefine the concept of, for example, “eye”, “ear”, “heart” and so forth? Will He redefine the concept of “Crying”, “Seeing”, “Walking”, etc?
Definitely if He did so, He would waste a lot of time, and according to our beliefs, negative adjectives like “Time Wasting” does not have any way to our GOD.
It seems that GOD has a template or model which all of these body parts and their functions have been defined in. This template is flexible like kids Play Dough so GOD can make changes He prefers while he is creating a new human. (For example He can make the eyes and ears smaller or larger, etc.)
When GOD wants to create a new human, there is no need to redefine the concepts of eyes or ears or the way they act…
The only thing He has to do is to choose some values like the color of eyes or the size of ears and put all of them (plus the Adam’s essence) in that template and the new human is ready!
OK, now in Object Oriented Programming we say:
Assume that a programmer is designing a program for a University. (University Management System). Will he define all properties and operations of each student separately and repeatedly? For example will he frequently define the concept of “First Name”, “Last Name”, “Father’s Name” and so forth? Will he say, “OK, “First Name” is string, its max-length is 50 characters, “Birth date” is DATE, its format is YYYY-MM-DD”, etc? Will he define the concept of “Add Student” and “Edit Student” for each student and in each part of the program separately?
Defiantly if he does so, he will waste a lot of time, but a good programmer does not waste the time!
It is better to create a Template and define all students’ properties and operations in it. This template should be flexible so that the programmer can change some parts while he is creating a new student. (For example in the previous example, GOD should be able to change the operation of eyes to create some blind or poor eyesight people, and now the programmer should be able to change some functions of “Add Student” for the students of different levels)
When the programmer wants to create a new student, there is no need to redefine the concept of “First Name”, “Last Name”, “Birth date” and “Add Student”, “Edit Student”, etc. The only thing he needs to do is to get some values for the properties (like “Hamid Reza” for “First Name” and “Niroomand” for “Last Name”, etc) and put all of them in the template and the new student is ready!
In OOP, that Template is called a CLASS. Those body parts like eyes and ears are called Property Names. Their values like “blue” or “big” are called Property Values. Their operations and functions are called Method and the flexibility of a class is called Overriding.
Anyway, I hope you have gotten the concept of Object Oriented Programming, otherwise you may need to review your OOP textbook :).
My aim in this post was to tell a story.
Every time that I say these concepts to my students in OOP classes, I wonder, “Does GOD really has a Class and Template for human?”
At our local mosque, people read a page of Quran every night. Two nights ago, when the reciter was reading the first Aya of Nesaa Sura, I became really surprised! My eyes were like thisShocked
Have a look at this Aya:
O mankind! Reverence your Guardian-Lord, who created you from one living entity
In English Translation نَّفْسٍ وَاحِدَةٍ has been translated as “One living entity” or “Single Soul” or “One being” but now, we programmers know that GOD is speaking to us! He means “I’ve used Object Oriented Programming in creating humans!”
Yes, GOD is an Excellent Programmer! 🙂
Wish you success.
Hamid Reza Niroomand

____________________

This is an English version of this post:

تشریح مبحث شیئ گرایی در برنامه نویسی با استفاده از قرآن

About admin

Comments

  1. al salam alikom,
    I like your topic, it’s is very useful.
    as you know my brother,islam is a comprehensive religion and many discoveries and inventions were mentioned in quran 1400 years ago.
    there is strong relation between Islam and Information and communication technology, and as you mentioned above, programming language and object oriented were implicitly mentioned in quran.

    I’m interested in your topic, and if you can write more about the same subject then I will be grateful.

    thanks

  2. سلام
    فقط می تونم بگم کاش شما استاد درس شی گرایی این ترم من بودید
    امیدوارم یه روزی بتونم از دانش شما استفاده کنم

  3. Dear Mr. Niroomand,
    Humbly, I am wondering if it would be OK if I could make some corrections on your articles as a person who has a master’s degree in English?

  4. Hi mr Niroomand

    It is very intresting post and great example.thank for your texts.
    good luck

  5. reader on February 1, 2015 at 5:38 am said:

    Effective text with so greate example, very good and thanks alot.I could get many things.
    good luck

Leave a Reply to amd Cancel reply

Your email address will not be published.


seven − = 0