December 24, 2014
September 17, 2014
August 3, 2014
June 5, 2014
April 20, 2014
April 5, 2014
November 19, 2013
August 7, 2013
August 5, 2013
September 1, 2012
Recent Posts
Featured Posts
What is Programming?
August 4, 2012
We “program” our VCR. That is a verb, an action. It is a process of telling the machine, in a fairly simple way, a series of things we wish it to do. Turn on at a set time, tune to a channel, record for 30 minutes. And so on.
We have programs on our computer. Nouns. Things. A program is a “thing” that inhabits our computer and which performs some specific task. Programs may be very simple, or very complex. A simple program might take an individual a couple of minutes, to a few hours to write. A complex program may take many people working together many months to write.
We use these programs in various ways to accomplish work. Another term for these programs is applications. A browser is an application. So is a word processor. Or a Music Player. These days we call them programs less often, as the term application has become preferred, and in fact the term application is evolving, being shortened to merely “App”. As in, Yeah, there's an App for that!
Sometimes we might tell these apps to do things in a manner not very different than programming a VCR. We might tell a calendar app to remind us of something, for example, to pay a bill, or take the dog to the vet. Sometimes, we might even call that action Programming! Although not really. In the minds of computer professionals, the term “Programming” is reserved for one thing: the art and practice of creating a “Program”. Perhaps one day we will call it “App'ing”. Probably not.
So what is a “program”, what difference is there between a program and an app, and how does one create a program?
That term program is not new, having been around at least since the days of Shakespeare. When Hamlet first said “The Play's the Thing!”, someone else probably said “You can't tell the players without a program”. In theatrical use, the term program (or sometimes programme) is defined as “an announcement of the events that will occur”, and often takes the form of a printed page, or pages.
How does this relate to computers you ask?
Well, simply that a computer program is really kinda the same thing. It is a document which sets forth a list of things that are to happen. These listed items are written in a specialized nomenclature called a “Computer Language” which we humans can read, and this is then translated into the low-level binary machine codes that cause our computer to carry out those actions. This act of translation is called “compiling” and the app that does that (yeah, it's an app too) is called a compiler. So in a sense, we could say that a written, human readable set of instructions is a program (much like Shakespeare's Programme) but the actual binary incarnation of that program, the “actor” if you will, is the App. The human-readable part is often also called the “source code”, and the compiled representation the “binary code”, but the terms “program” and “app” work as well, and somehow seem more appropriate in today's mass-market computer world.
Programming, or creating one's own apps, may not be for everyone. Many computer users feel no need for anything more than using their browser to surf Facebook, or Ancestry, or the latest news sites. Many more prefer to use the machine to write their Great American Novel, or keep their business' books. One can use a computer for a lifetime and never need to program anything. However, many feel as if there were a huge “wall” between the common user and the world of programming, and that one must have special training, an expensive college degree, and master arcane black arts to learn to write their own programs.
In fact nothing could be further from the truth! Programming can be as simple, or as complex as you care to make it, but is not out of the reach of most ordinary users, if they have a little motivation. You do not need extensive college courses, or need to buy expensive books. All the training one needs is freely available on the Web, and so are all of the tools, and instruction in their uses.
This is not to say it is necessarily easy, but it is not as difficult as many suppose, and anyone with a little time, a little dedication and a decent number of functioning brain cells can learn to write their own programs.
Not so long ago, this was taken as self-evident fact. All computers came with, at minimum, a simple computer language called BASIC (an acronym for Beginner's All-purpose Symbolic Instruction Code) and even had very good manuals designed to teach the user how to get started. Author David A. Lein wrote an excellent manual that was included with the first Radio Shack computers, and made quite a name for himself promoting ease of programming. Today's environment is a bit more complex, but still quite accessible. Mr. Lein has not updated his excellent early work for today's world, but there are other sources of instruction around, many for free on the web.
Today's computers generally do not come with a built-in language, but there are lots of free and accessible tools anyone can use with only the most trivial of efforts. We are, in fact, almost overwhelmed by the number and variety of programming tools available, from extremely simple to absurdly complex, and every single one of them has a bit of a “religion” built around it. Programmers become adapted to their favorite language and defend it against all criticism with a near religious fervor.
My personal favorite is a free and open-source language called Perl. Perl has four things to recommend it, in my mind. (1) It is free and open-source, meaning it is both free to obtain the compiler and other tools, and that there are no royalties to pay when selling finished programs. (2) it is very forgiving of many of the simple mistakes a neophyte programmer might make, and will still usually do the right thing even in the face of rather egregious errors. (3) It is widely used, and there is tons of documentation online, along with lots of volunteers who will lend a bit of help. (4) There is a vast library of pre-built modules and functions that allow the less skilled programmer to create programs of immense complexity with very little work.
My own personal enthusiasm for Perl however should not be taken to mean it is perfect, or that it is the right tool for every job. This treatise however is not about programming in perl. It is about the general idea of programming, and that programming is or should be accessible to anyone who is interested. Beyond that, even if one has no real interest in a specific programming project, it is an interesting intellectual exercise anyone with a bit of curiosity may wish to investigate. We are not here today to teach anyone how to program, but merely to explain in simple terms the elements of how and why one might do so. In another article I hope soon to give a bit more of a how-to example for the more curious.
The next article on this topic will explain how to download and install the Perl software. If you have a Mac, or a Linux system, you already have Perl. A Windows PC requires just a bit more work, but not much. We will end this discussion by showing the text portion of a very simple Perl program. It looks like this:
print "Hello, world!\n";
That's it, one line. It consists of a single keyword, or verb denoting an action to take, to print something, and the data to use for that action, the text phrase “Hello, world!”. There is one more item, a bit less obvious, the “\n”. This is Perl notation denoting a newline character, or as it was known in the days of the typewriters, the “Return”. The semicolon at the end merely tells Perl that it is the end of this statement. Another statement might follow the first, for example, even on the same line.
That's it! That's all there is to it!


