Programmer's Corner - If the World is a Program

Backup and Security Solutions 10% off all products with promo code: VISI-P1YR
Get the Programmer's Corner FireFox Search Plug-In

If the World is a Program

When we first learn geography we learn about how the world first came into existence. Some say that the Earth owes it's existence to a massive supernova while some others say that it is just one of God's beautiful creation. I have an ideology of my own which supports neither of the two yet in some way or the other resembles each belief.

What if the world was a program? Imagine time as a snippet of code that changes the environment and the components located within it after every CPU clock cycle. Let's think object-oriented for a while. Now, I belong to a class MALE which inherits its properties from class HUMAN which in turn also inherits its properties and methods from class MAMMAL. Class MAMMAL can also be derived from class LIVING_THING. On the other hand a wooden chair belongs to a class MADE_OF_WOOD inherited from class CHAIR that inherits its properties from class Non-Living.

We all have studied at least the basics of Chemistry. Every element is an object of its respective class containing atoms of class ATOM which contains electrons, protons, neutrons, positrons etc. also of their respective classes.

Compounds would have their own classes that would look similar to the code snippet given below:

 
class COMPOUND {
	private:
	ELEMENT e[];
	enum nature={"acidic","basic","amphoteric","nuetral"};
	float pH;
	// etc...
 };

Genetics is an interesting subject that is similar to inheritance in classes. When a child is born his/her MALE or FEMALE class will have genes as its data members, which would inherit all it's genes partly from his/her mother and partly from the father. This also shows that the class CHILD shows multiple inheritance since the declaration would be like this:

class CHILD:private FATHER,MOTHER {
};

The genes would be initialized in the constructor of the class i.e. The function would be called when the body first comes to existence in the mother's womb. Just like how a constructor is called when a living thing is born, a destructor would be similarly called when an object dies i.e. ceases to exist. The Destructor would then deallocate memory that was occupied by the living object and it would also contain the code for the object's decomposing or disintegration depending whether it belongs to NON_LIVING or LIVING class.

Besides all these factors there are some questions that remain unanswered. If the world really is a program which programming language is it written in? If it was written in Java does it mean that each and every class in the world are derived from the 'Object' class?

Since a program has to be written, who wrote it? Just like every other program, does it have bugs, vulnerabilities that can be exploited? Meanwhile another question came to my mind and it was a slightly scary question. And my question was that if the world was just like any other program.... Does it terminate? When?



Author Information:

Sanchit Karve

http://www.freewebs.com/born2c0de/

born2c0de@hotmail.com

Comments:

Add your comments here.

Name

Comment

You can also send feedback to feedback@programmers-corner.com


Peter Dobling Ph.D - April 21, 2005 10:39 PM

Theoretically our existence can be expressed in the form of a program but its language would be astronomical in terms of its complexities ex. User defined language where each unit (atom, molecule, particle, cell, tissue, organ, organism.) is controlled by a highly complicated system of mathematical equations and expressions.


natriss102 - August 2, 2005 9:00 PM

i've often found my mind wondering something along these lines as well. I'd have to say one of the things that sparked this kind of thinking for me was the ending of the movie Men In Black, where the galaxy is just a marble


natriss102 - August 2, 2005 9:06 PM

or maybe this is like the matrix


o - September 29, 2005 12:38 PM

or maybe you have too much time on your hands. though actually programs work by the start with one thing affecting another. you could say its like a giant program that starts making changes and then keeps changing based on those first changes, which is why one persons interaction or lack in anothers life in a single moment has a permanent affect on both people involved. programs are reactionary, and so is the universe, which includes people. If some1 is born then they will become a chemically active, living being. If brain chemistry = y and home environment = x and outside influences = z then person a = xyz. of course its more complicated. every change to anything in your environment causes a subconscious and conscious change. food and drink changes the chem % in your body affecting your state of mind, emotional state, and the fact that the subconscious and conscious are always working means for every instant in time(whatever your thoughts on time are) there is information going back and forth to both between the two, and the subconscious and since the subconscious processes all changes then presumably the same things it processes causes a change in it to cause more processes to occur and causes it to change/process again. The aha experience is the sudden revelation, where you simple "get" the answer seemingly out of nowhere. obviously the subconscious was given enough time to process all the information you consciously searched for(and what you also unconsciously absorbed) and gave the conscious a little nudge in the right informational direction. a persons state of mind depends on the senses, and if something they smell brings back a memory their state of mind becomes affected and their emotional state changes, unconscious and conscious create new cycles of calculations and all that junk.

id say based on the way the two interact, it would seem that if x = sub y = con z = life( or in other words, the external(world/universe) environment, and the internal(body/chemical) environ) then its possible y = xyz and x = xyz. basically the current state of mind and the processing of information in both areas sub and con are constantly changing based on the current + the incoming information, with the sub connecting past or memory to present, extrapolating future, and interacting with the con which can barely be aware of its own existance, let alone all these other things.

everything depends on calculations, whether real world or program.