Friday, February 16, 2007

Programming Magic

Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate other abstract things called data. The evolution of a process is directed by a pattern of rules called a program. People create programs to direct processes. In effect, we conjure the spirits of the computer with our spells.

A computational process is indeed much like a Wizard's idea of a MAGIC(yes, the same type of magic in Harry Potter, LOTR,etc). It cannot be seen or touched. It is not composed of matter at all. However, it is very real. It can perform intellectual work. It can answer questions. It can affect the world by disbursing money at a bank or by controlling a robot arm in a factory. The programs we use to conjure processes are like a spells in HP. They are carefully composed from symbolic expressions in arcane and esoteric programming languages that prescribe the tasks we want our processes to perform. Magic Spells are carefully composed in Elven Language (Refer: Eragon, LOTR).

Fortunately, learning to program is considerably less dangerous than learning Magic Spells, because the spirits we deal with are conveniently contained in a secure way. Real-world programming, however, requires care, expertise, and wisdom. A small bug in a computer-aided design program, for example, can lead to the catastrophic collapse of an airplane or a dam or the self-destruction of an industrial robot.

Master programmers have the ability to organize programs so that they can be reasonably sure that the resulting processes will perform the tasks intended. As Top Wizards like Dumbledore or Lord Voldemort have the ability to organize and control their Magic Spells.

Master Programmers can visualize the behavior of their systems in advance. They know how to structure programs so that unanticipated problems do not lead to catastrophic consequences, and when problems do arise, they can debug their programs. Well-designed computational systems, like well-designed automobiles or nuclear reactors, are designed in a modular manner, so that the parts can be constructed, replaced, and debugged separately.

Djinn/Wizard need to visualize the behavior of their Spells and their consequences (The Children of Lamp).


Any sufficiently advanced technology is indistinguishable from magic.
-- Arthur C. Clarke

(Reference: Structure and Interpretation of Computer Programs)

No comments: