Thursday 26 May 2011

A Variable is a Cloning Machine


Variables are like cloning machines. The value assigned to the ‘int’ or ‘float’ variable is like the shape which you wish to clone. The shape is placed in the left compartment of the machine. The red button is pressed, causing the machine to begin the process of cloning. This is akin to the act of typing the variable into the code after the value has been assigned to the variable. The shape can be cloned as many times as the user desires. Therefore, you can clone the red shape infinite times to create interesting results. 
           
The left compartment stores the initial shape, so that cloning is always possible. This is like the ‘memory’ or ‘storage’ of the variable. In this case, an abstract form will be retrieved from the machine when it is needed. The red shapes act as the medium which construct free-flowing patterns. These are like the numbers which build code. By a press of the button, more shapes can be cloned, just as the same value can be used several times within a code through the use of variables. Without the cloning machine, the shape would have to be manufactured every time the user wanted to add another one to the pattern. Without variables, the same situation occurs. The required code would have to be typed out each time it is necessary. Variables are vital in creating interesting programmes with less lines of code, just as a cloning machine is essential in the building of an interesting form composed of multiple identical shapes.

No comments:

Post a Comment