Friday, April 22, 2011

The computer program with a will

The programmer leaned back on his chair and sighed. He had just written a perfect program. The program was complicated and could do many, many things. But it had only one purpose. To make the programmer happy. To give him pleasure. The program had many abilities. It even had its own internal concept of happiness. The program was made such that it always tried to keep its internal boolean variable - 'happy' to true. But the purpose of the program was ultimately to make the programmer happy too. So the willy programmer had put in and if condition: 
if program makes me happy
     program.happy=true
else
     program.happy=false

And then the programmer did the ultimate programming. He gave the program 'free will' The program could run as it wanted. It could execute whichever line of code whenever it wanted and experience the results. The program was given a choice. It could choose to make the programmer happy or it could choose to ignore the programmer. And then the programmer ran the program.
       The program ran as it chose to. It had the choice remember? It kept trying to make program.happy to true. But no matter what it did, that silly variable always remained false. The program thought, very often, that it had come close. But that was illusion- temporary. Only when that program discovers that tricky if condition will it achieve true happiness.

We, the soul , the living entities are that program - and God our maker is the programmer. As long as we are disconnected from Him, no matter what we do - we'll never be truly happy. For those who think that eternal happiness is a myth, a delusional concept, just have to discover that if condition in their source code. :)  


6 comments:

  1. Nice metaphor! :)
    If God is happy, then program is happy! Smart coding! :P

    ReplyDelete
  2. Aah! I didn't get the point till I read the last para. Nice effect

    ReplyDelete
  3. Deep stuff you write ! What happens when there is a for loop ? Initially thought you were inspired by Robot...the program going out of hand was similar to the robot in the movie going out of hand....

    ReplyDelete
  4. I knew it!! God had to be a comp engineer!! But jokes apart, nice concept illustrated beautifully...

    ReplyDelete
  5. @All - Thank-you :)
    @Ranjan - Where is the for loop exactly?

    ReplyDelete
  6. "As long as we are disconnected from Him, no matter what we do - we'll never be truly happy" Aah.. !!
    Well, I'm sorry but I kinda disagree to that thing or perhaps its my bad I didn't understand your idea of "disconnected". If the "program" is happy for what it is executing, doesn't matter what the boolean variable is set. If it is set to false, take it as a good learning experience for future.. and I don't think that is wrong. I'll be fortunate to learn that !! Introspection/Being Religious is a good thing.. but at the same time it creates problems exceeding it beyond a certain limit..!!

    ReplyDelete