Basic Programming Concepts
Objectives
By the end of this reading you should be able to answer the following questions:
What are the three concepts fundamental to programming, regardless of the language?
Understand when each of these concepts might apply when writing a program.
Name two strategies that can be helpful in planning your program.
● What is Programming?
In the most basic sense, programming means creating a set of instructions for completing
some specific task. In this sense, many of our daily activities can be described as
programmatic—they involve specific steps that often follow a set order. For instance, if you
get home from school and want to make yourself a peanut butter and jelly sandwich, you
know that you will have to get two slices of bread, butter each piece, spread peanut butter on
one slice and jelly on the other, and finally put the two together. If you leave out a step you
might end up with something other than a PB&J sandwich. If you do things out of
order—say, you put the slices of bread together before you spread the peanut butter—you'll
end up with a mess.
● Apple pie recipe
In this general sense, our lives are filled with programs and programming. When you make
your bed you follow certain steps in a programmatic fashion. The steps must be the correct
ones and they must be in the correct order. If you want to make your grandmother's favorite
apple pie, you would ask her how to do it, and she would most likely send you a program—a
recipe. A program is therefore also useful for replicating a product even if you are far
removed from the original creator of the product.
But programs are not only useful for reproducing products. Humans—even young
children—have a remarkable capacity for mastering programmatic processes and behaviors.
Take the familiar children's game, One Potato, Two Potato. This chant is a common way for
children to choose who is going to be "it" in a game. The children will all stand in a circle
around the counter and hold their fists out in front of them. The counter recites the rhyme,
striking each fist in the circle in turn for each word of the rhyme. When the counter strikes a
fist on the last word of the rhyme—"...seven potato, more."—that fist is knocked out of the
game. The counter then repeats the rhyme, each time knocking out another fist. The last
person with a fist remaining raised is "it". This simple game has all of the elements of a
program—a set sequence of events, actions performed based on the outcome of a process,
and repetition.
In the context of computing, programming means creating a set of instructions not for a
person but for a computer, in order to accomplish a specific task. To do so you use a set of
directives—a programming language—known to both the programmer and the computer
operating system. The kind of things we program computers to do is different from what we
“program” ourselves to do. Usually a set of instructions, or program, for a computer is
intended to complete a task that:
Objectives
By the end of this reading you should be able to answer the following questions:
What are the three concepts fundamental to programming, regardless of the language?
Understand when each of these concepts might apply when writing a program.
Name two strategies that can be helpful in planning your program.
● What is Programming?
In the most basic sense, programming means creating a set of instructions for completing
some specific task. In this sense, many of our daily activities can be described as
programmatic—they involve specific steps that often follow a set order. For instance, if you
get home from school and want to make yourself a peanut butter and jelly sandwich, you
know that you will have to get two slices of bread, butter each piece, spread peanut butter on
one slice and jelly on the other, and finally put the two together. If you leave out a step you
might end up with something other than a PB&J sandwich. If you do things out of
order—say, you put the slices of bread together before you spread the peanut butter—you'll
end up with a mess.
● Apple pie recipe
In this general sense, our lives are filled with programs and programming. When you make
your bed you follow certain steps in a programmatic fashion. The steps must be the correct
ones and they must be in the correct order. If you want to make your grandmother's favorite
apple pie, you would ask her how to do it, and she would most likely send you a program—a
recipe. A program is therefore also useful for replicating a product even if you are far
removed from the original creator of the product.
But programs are not only useful for reproducing products. Humans—even young
children—have a remarkable capacity for mastering programmatic processes and behaviors.
Take the familiar children's game, One Potato, Two Potato. This chant is a common way for
children to choose who is going to be "it" in a game. The children will all stand in a circle
around the counter and hold their fists out in front of them. The counter recites the rhyme,
striking each fist in the circle in turn for each word of the rhyme. When the counter strikes a
fist on the last word of the rhyme—"...seven potato, more."—that fist is knocked out of the
game. The counter then repeats the rhyme, each time knocking out another fist. The last
person with a fist remaining raised is "it". This simple game has all of the elements of a
program—a set sequence of events, actions performed based on the outcome of a process,
and repetition.
In the context of computing, programming means creating a set of instructions not for a
person but for a computer, in order to accomplish a specific task. To do so you use a set of
directives—a programming language—known to both the programmer and the computer
operating system. The kind of things we program computers to do is different from what we
“program” ourselves to do. Usually a set of instructions, or program, for a computer is
intended to complete a task that: