Tenet 9: Make every program a filter

6.2 Tenet 9: Make every program a filter

6.2.1 Every program written since the dawn of computing is a filter

Every program-no matter how simple or complex-accepts data in some form as its input and produces data in some form as its output. How the program filters the data presented to it depends on the algorithms contained therein.

Most people accept that programs such as text formatters and translators can be considered filters, but they have difficulty realizing that the same holds true for other programs not ordinarily regarded as filters. Take real-time data collection systems, for example. Typical ones sample analog-to-digital converters at periodic intervals to gather data for their input streams. They then select appropriate portions of this data and pass it to their output streams to user interfaces, other applications, or files for storage.

Do GUIs act as filters, too? Absolutely. GUIs normally process mouse button actions or keystrokes as "events." These events form the data stream fed to the input of applications on the screen under control of the window system. The applications, as filters, respond to these events, effecting changes on the display.

There is also the question of those programs that fail because of hardware errors. Suppose a program encounters a hard error in reading from a disk. Instead of getting data back when it tries to perform a read operation, it receives an error status. Most of the time it will filter the error indication and produce an error message to warn the user. In other words, an error status as input produces an error message as the output. The algorithm that figures out the error message to produce acts as a filter for the error condition as input.

6.2.2 Programs do not create data-people do

People commonly believe that their applications create data when applications are really incapable of manufacturing data. Data synthesis requires creativity. It requires an original source of information. A computer has no original source of information.

When a person uses a word processor, the text being written comes from that person's mind. The word processor functions solely as a tool for gathering ideas and storing them in a format easily housed and manipulated by the computer. It cannot write a book any more than a hammer and a box of nails can build a house. The more intelligent word processors-the ones we call "What You See Is What You Get" or WYSIWYG types-may do some filtering such as formatting and justification, but they still do not formulate the ideas in the first place.

Real-time programs that gather information about the world around us do not create data either. The data already exists. By extracting readings from their environments, the programs perform a process of selection. Only important data passes through the programs' filters so it can be saved.

The world is full of data created by people. This data would still exist if the computer had never been invented. The computer simply makes it possible to gather and filter the data more efficiently. Any "new" data produced is not new at all. The computer just gives us an opportunity to manage it in a different way. If the world were full of computers without any people, there would be no data.

6.2.3 Computers convert data from one form to another

An alternative view is that data, to be useful to most application programs, must be stored in a format that facilitates its manipulation. For example, the actions of a person depressing keys on the keyboard are of no value to a piece of software. However, once these actions are converted to a series of electronic impulses representing binary data, they suddenly take on a new life within the machine. Then the software can convert the data into a multitude of forms to serve any number of purposes.

An interesting side note here is that music is simply another kind of data. It has existed for centuries in one form or another. People have been playing stringed instruments for several thousand years. The piano, a stringed percussion instrument, has been around for many centuries. Player pianos contained rolls of paper with holes punched in them to "remember" the notes of songs. In recent years, though, the keyboard synthesizer has become the primary means to gather "data" produced by musicians moving their wrists and fingers. Once captured, the data is converted to MIDI files, the music industry's standard format for electronic music representation. As MIDI files, the data can be filtered in limitless ways, resulting in the production not only of piano tones but of other sounds beyond the capabilities of any natural acoustical instrument. In many ways, the music world's use of MIDI is still in its infancy. Future MIDI applications will bring us musical flights that will stretch the envelope of human audible perception. This will occur because of programs that can filter musical data in ways previously considered impossible. Most certainly, it will be computers that will modify and enhance MIDI data to produce new, creative sounds.



Linux and the Unix Philosophy
Linux and the Unix Philosophy
ISBN: 1555582737
EAN: 2147483647
Year: 2005
Pages: 92
Authors: Mike Gancarz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net