The Art and Science of Programming with Euphoria

Computer programming is an artful science. I say that because there are almost as many solutions to a particular programming problem as there are programmers. One programmer will "paint" a solution one way, another will "paint" it some other way. Both might be just as beautiful. The science of programming comes in when one program proves to be more efficient than the other. Some programs are more efficient than others, and some code looks better than others, just like the portraits of a woman painted by different artists will each look different. Some will look exactly like her, as though it was a photograph, while others will be more abstract, maybe showing no recognizable definition at all. The point is, a programmer is given a set of tools to provide input to a computer to get some output. There are no other constraints. Of course, one must understand the syntax, or formatting and grammar rules, of the input so that only good input is provided to the PC. A PC doesn't understand English (as we saw last chapter)! In fact, a computer's vocabulary is very very small. You want to be sure that the PC understands all the input you provide. Otherwise, you'll get bad output (like those error messages we saw last chapter). The process of giving a computer input it won't understand, and receiving undesired or unexpected output, is referred to as "garbage in, garbage out."

As an example, a programming contest was run in March of 2002 by Rapid Deployment Software, the makers of the Euphoria programming language. The purpose of the contest was as follows:

Write a program that tries to decipher a text file that has been encoded using a simple one to one cipher where each letter of the alphabet A-Z and a-z has been replaced by a different letter, but blanks, tabs and punctuation characters have been left alone.

There were a variety of entries, and each programmer approached the problem differently. Your approach might be unique as well. And while all of these programs accomplished the job, only one could be rewarded to getting the job done most efficiently.

Click here to see the contest specifications. Scroll down the news page to see the results.

The purpose of a hobbyist programmer is to know his art well enough to get the job done. The purpose of a paid programmer is to know his art well enough to get the job done most efficiently.