Category Archives: Uncategorized

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:

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

Internet still needs some improvements!

It’s about 4 hours that I’m looking for a couple of drivers for an Apple MacBook Pro laptop (for windows 7).

It is really funny that I finally couldn’t even understand whether these drivers has been presented by the manufacturers or not!!

I explored more than 20 websites which I referred by Google but each one has its own method to catch money not to handle my problem 🙁

More funny than that is that the manufacturers’ websites (specially Broadcom and AMD websites) are like a puzzle!! You have to click this link, then that link, again another link and finally nothing!! Instead they could print a Serial Number or Code on the product or a digital code on the heart of the product (which is visible to the OS) then they could put a clear link called “Download Driver” then they ask that serial number or code or part of the product name then suggest some download links… (Or clearly answer: There is no driver for the OS you’re looking for)

They must consider the customers! We don’t have that much technical information about their product model or exact name, etc.

On the other hand, Google should manage its results on a better way! It could put more reliable websites on the top of the results page, but now, unfortunately some “Spam Link algorithms” have caused some spam websites be upper than others 🙁

I personally prefer WolframAlpha because of its fantastic management of data, I’m sure that Google finally has to do so!

Anyway, seems that we have a long way to reach to a fast Internet! (Not fast in speed but the way you could find exactly what you want)

Hope we see that world 🙂

Hello world!

Hi there and welcome to my English blog 🙂

I’m sure that you know that I write in Persian at hamid.aftab.cc but from now on going to write in English here, just to improve my English grammar and writing skill.

Surely I’ll have some mistakes at the beginning but I hope that I would correct them ASAP. Please tell me my mistakes and help me to improve my English.

Going to write about anything, so there would not be any specific structure or subject. e.g: about what happened during the day, what I think about something, what I’d like to do, etc.

Don’t forget to send me your feedback 😉

Hope you enjoy the posts 😉