Software


You've learned some of the basics of computer hardware.  Computer hardware is the
actual physical components that make up the system--the monitor, the hard drive,
the CPU chip, the case, etc.  Computer software is what makes the computer run and
do various tasks.  It would be nice if there were always a clear-cut distinction between
the two--but such is not the case.  Sometimes this dividing lines gets rather blurred.
It may be helpful to think about yourself.  You have a physical body--the skeleton,
muscle, blood vessels, fingers, etc.  You also have the "software" equivalent--the
thoughts and ideas and knowledge inside your head.  You use this "software" to
interact with other people and the world.  You have I/O devices.  You have, so to
speak, a CPU.  But as with computers, the dividing line can be blurred.  You develop
instinctive reactions--you are not carefully and consciously processing each word in
this sentence--you do not have to pause and think about what the word "what" means,
for example.  You can walk without having to think about the movements of each
muscle.  Computers have ROM (read-only memory) and flash RAM that has information
stored in it.

A program is a set of instructions that tell the computer how to do something:  we all
have programs ourselves as well that tell us how to do things.  For example--we know how
to read a book.  We go to page 1--near the front of the book--and read sentences from
left to right, going down one line when we reach the end of that line, and going to the next
page when we reach the end of a page.  We don't have to think carefully about what we're
doing--it has become automatic.  You should also be aware that there are other "programs"
for reading--in many cultures, you read lines from right to left or read in columns from top
to bottom.   Humans have a very wide variety of languages.  Languages follow sets of rules
for how to form correct sentences.  You're familiar with English.  But even here there are
many of what might be termed "sub-languages" used by different groups.  Consider trying
to read a medical book written for doctors, not laymen.  Or try to read legal opinions.

Computers have languages as well.  Some of these are what is called "general-purpose"
that can do a wide variety of tasks, others are specialized, designed for particular applications.
You've seen html  (which stands for HyperText Markup Language".  html is designed to tell
web browsers what to put on web pages--commands such as "font" for instance.  html is
useless for tasks such as managing accounts or databases.   Think also of carpentry tools:
hammers and saws (the old-fashioned saws) are general-purpose tools.  People used to build
houses with them.  A nail gun is a specialized tool--more popular than a hammer with most
home builders nowadays--but try pulling out a bent nail with a nail gun.

In a program--whether it's a computer program or a "human" program--the order of the
instructions is usually very important.  Consider a simple task such as walking down a
flight of stairs:  you need to pause and think what you actually do here.  You move your left
(say) foot forward over the next step down.  You bend your right knee, keeping your balance
since your left foot is in the air.  When your left foot is on the lower stair you transfer your
weight to that foot, bend your right knee even further so that your right foot is a little
in the air, bring your right foot forward so that it's over the step below where your left foot
is planted, etc.  Thinking about each step (pun intended) in the process complicates matters.
The sequencing of the operations is vitally important--otherwise you'd fall down every
flight of stairs.  Suppose, for example, when your left foot is in the air prior to bending your
right knee you move your right foot forward (how the heck could I do that? you might think).
Down the stairs you tumble.  Or suppose you bend your right knee prior to moving your left
foot forward--you fall over to your right, then down the stairs you tumble.   It seems almost
like a miracle that you could ever descend a flight of stairs.  Computer programs have the
same problems--the order/sequence of instructions is usually vital.  Consider your html
pages you created.  For most of html, when you have something like <A you'll later on need
to do </A.  If you put </A before the <A, html gets all confused.  The order of things does
indeed matter!

 We are going to be teaching you a general-purpose programming language called
Python.  There are lots of general-purpose languages, including basic, FORTRAN, C, C++,
etc, and some of these, such as FORTRAN (FORmula TRANslation) date back to the 1950's.
What we want to do is to teach you the basics of a general-purpose programming language.
We are not going to make you into experts, nor is that our wish or intention.  There are two
basic kinds of computer software.  One kind is special-purpose, such as html.  The other
kind is general-purpose, such as Python.  When you look at web pages, you're making use
of special-purpose languages.  But the browser itself--Firefox, Explorer, etc--will be
written in a general-purpose language.  Notepad, Word, Excel, Quake, Windows XP, etc
are all written in general-purpose languages.  A general-purpose langauge needs good
facilities for doing input and output, making decisions based on data values, etc.  Think
of a game like Quake or Doom--there are an awful lot of different things you can do at any
time--such as going to a pop-up window that lets you change weapons.  We want to give
you a flavor of what general-purpose languages need to be able to do--this will help you
to understand further about what computer software is actually doing inside your machine.