Datasheet

14
Part I: Getting to the Starting Line
Peanut Butter
Jelly
2 slices of bread
Similarly
Place the two slices of bread close to each other
Spread peanut butter on one slice of bread
Spread jelly on the other slice of bread
Put one slice of bread on top of the other
are simply instructions on how to take the ingredients and make a sandwich.
Spread peanut butter on one slice of bread is the instruction.
Actually, spreading the peanut butter is the operation you are performing on
the pureed peanuts being referenced by the peanut butter variable.
Understanding How Computer
Languages Work
While conceptually it is pretty easy to understand computer programming —
all you are doing is giving it a set of instructions and some data on which to
perform those instructions — one of the challenges, as I mentioned previ-
ously, is that it’s not that easy to tell a computer what to do.
Computers don’t speak English, although computer scientists have been
working on that for years (think of trying to do that as the Computer Scientist
Full Employment Act). A computer actually has its own language made up of
ones and zeros. For that matter, Objective-C is not something a computer can
understand either, but it is a language that can be turned into those ones and
zeros by using a compiler. A compiler is nothing more than a program that
translates Objective-C instructions into computer code.
Creating a computer program
To create a computer program using a computer language, follow these steps
(see Figure 1-3):
1. Decide what you want the computer to do.
You can have the computer write a line of text on the monitor or create
an online multiplayer game that will take two years to complete. It really
doesn’t matter.
05_522752-ch01.indd 1405_522752-ch01.indd 14 8/27/09 9:45:02 PM8/27/09 9:45:02 PM