I often try to break down computing into its core form and function; the act helps one maintain perspective on the full scope of power of the technology. At base, what is a computer? A device to manipulate information. That is, a machine that assists you in reducing something to an abstract representation (information), and can then modify or examine that abstraction quickly. Fundamentally, the work done by any computer is simple, or can at least be reduced to simple steps--assembly commands are essentially a form of arithmetic. There is nothing a machine can do that you or I can't... a computer can simply do these simple things orders of magnitude faster. They can do complicated things quicker, and that speed enables them to realistically manipulate information in ways the unassisted human mind cannot.
So what is ultimately the force driving the analysis or manipulation of information? Programs. A computer, being an all-powerful tinkerer of data, can manipulate information in any possible way. Any way data can be changed, a computer can do. And the expressive language for that is programs. A programming language can be called "turing-complete" if it exhibits this characteristic, if it is capable of all forms of information processing.
A programming language is fundamentally a description of a pattern... it describes some relationship between kinds of data, and how to act on them. A larger program is made up of many simpler patterns--methods, subroutines.
When you recognize that programs are an arbitrary data container for any and all patterns, something interesting is revealed about software engineering: any architectural style, design pattern, or coding technique can be explicitly defined as code. If your style cannot be, then it is either an inconsistent pattern (and thus not really a pattern), or your description of the pattern is incomplete. Programming languages are literally a pattern-description language, and a complete one at that.
So why don't textbooks describe design patterns as code, and instead portray them as "ideas"? Ultimately, this is due to the presence of a human mediator; the human machine has evolved to process information by a completely different descriptive languages, and very different algorithms. What is effective for a computer, is not necessarily effective for a person, and at this point in history, it is the person that is writing programs. That said, most patterns do have explicit definitions in many languages. The observer pattern is built into Smalltalk. The object-oriented paradigm (itself a design pattern) is fundamental to a number of programming languages. Well-designed interfaces can effectively permit any pattern to be expressed within the language.
If I may be permitted to take an aside... if programs are simply a representation of patterns (a translation of "concepts" into "information" such that a computer may work with them), then where does the mind fall into this structure? By some definitions, a "mind" is simply any system that processes and responds dynamically to information. Could a "mind" itself simply be a program, a layering of patterns?
Enticed by the prospect that this blog entry lay on the cusp of enlightenment, I decided to open up a dialog with legendary Chinese philosopher, the Great Master Lao-Tzu. Certainly, he can show me the way.
Kurt: We live in a universe exhibiting an astounding variety of patterns. How do you make sense of such incredible complexity?
Lao-Tzu: All difficult things have their origin in that which is easy, and great things in that which is small.
Kurt: Exactly! An endless layering of simple patterns can give rise to the deepest of functions. Can this include the human mind?
Lao-Tzu: Nature is not human hearted.
Kurt: No, but is the human nature-hearted? Are we merely a specialization of universal operation, an instance of self-organization and programmatic expression? Are we not a vast compendium of nature's rules?
Lao-Tzu: To see things in the seed, that is genius.
Kurt: So you agree! By Jove you agree! Then the act of finding patterns is the act of returning to the root of organization? And the act of documenting the sub-programs of the mind, the more rules that are discovered, the more easily those patterns can be discovered?
Lao-Tzu: The more laws and order are made prominent, the more thieves and robbers there will be.
Kurt: Wait, do you imply that one most look then from the ground up, rather than from the top down? Is there deceit in comprehensiveness?
Lao-Tzu: He who knows, does not speak. He who speaks, does not know.
Kurt: Are you calling me verbose? And also, wait... you just said that... doesn't that contradict--
Lao-Tzu: The words of truth are always paradoxical.
Kurt: But every paradox has a resolution. What is the resolution to the statement you just posited?
Lao-Tzu: I have just three things to teach: simplicity, patience, compassion.
There was a great tremor and the black hole collapsed in a most extraordinary fashion, light sputtering from the abyss, great and rapid shifts in the temperature of the room. GRUMPs stood still, smoke emanating, both exhausted and tranquil.
Okay, screw revelation. I have time-machine fixing to do.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment