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:
Obtain car keys from key rack next to door
Open door to outside
Walk outside
Shut and lock door behind you
Walk to car and enter it
Drive to Grocery store on 6th and Main
Stop car and get out of car
Enter Grocery store and proceed to bakery
Obtain loaf of bread
Proceed to checkout
Purchase loaf of bread
Return to car and enter it
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.