These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

JAVA01/What Is A Program

Classnotes | JAVA01 | RecentChanges | Preferences

A computer program is really nothing more than a set of instructions for accomplishing some task. Literally everything you interface with while using a computer is a program of some sort.

Example programs:

  • Web-browsers: Client programs that are used to interface with web-servers and allow you, the user, to browse around the world wide web.
  • Word Processors: Programs that allow the user to edit and create documents.
  • Video Games: (One of my favorite types of programs) Diversions from reality.
  • Operating Systems: (Such as Windows, Mac OS, Linux, etc.) Low-level interfaces between user-level programs (such as word processors and web-browsers) and the computer's hardware (such as hard drives, keyboards, ethernet cards, etc.)

On modern computer operating systems, there are usually several layers of programs running between you and the computer hardware. For example, you will often have a Graphical Program built on top of a Graphical Widget Set, built on top of a set of Libraries, built on top of a low-level interface, built on top of an operating system.

Algorithms

The instructions that I mentionned above are refered to as algorithms, and often need to be very precise and very logical. Consider the simple task of going to the store to buy a loaf of bread, a possible algorithm for this task is as follows:

  1. Obtain car keys from key rack next to door
  2. Open door to outside
  3. Walk outside
  4. Shut and lock door behind you
  5. Walk to car and enter it
  6. Drive to Grocery store on 6th and Main
  7. Stop car and get out of car
  8. Enter Grocery store and proceed to bakery
  9. Obtain loaf of bread
  10. Proceed to checkout
  11. Purchase loaf of bread
  12. Return to car and enter it
  13. Drive home

As you can see, even the most simple instructions can become quite complex. You may also find that specifc steps in these instructions are not self-explanitory and need sub-instructions themselves.

For example, we said "Drive to Grocery store on 6th and Main": What if the person following this instructions did not know the layout of the town to find 6th and Main? What if they did not know what a Grocery store was? What if they did not know how to drive?

In order to think like a programmer, you must see problems in this way and pay great attention to detail.



Classnotes | JAVA01 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited May 26, 2003 6:00 pm (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.