Datasheet

18
Part I: Getting to the Starting Line
But it takes more than a language to write a program; it takes a village. So
who lives in the Objective-C village? Most object-oriented development envi-
ronments consist of several parts:
An object-oriented programming language
A runtime environment
A framework or library of objects and functions
A suite of development tools
This is where, for many people, things start to cloud up. You mean I have to
learn more than the language, and what is all this stuff about runtime envi-
ronment and frameworks and libraries? The answer is yes; but not to worry.
I’ll take you slowly through each part. The following sections cover each part
of the Objective-C development environment.
Understanding programming languages
When you write a program, you write it as series of statements. Some of these
statements are about data. You may allocate areas of memory to use for data
in your program, as well as describe how data is structured. Other state-
ments are really instructions for the computer to do something.
Here is an example of an Objective-C statement that adds together b and c
and assigns the result to a (and you thought you’d never use all that algebra
you learned in school):
a = b + c;
Statements like these use operators (like + or -) or tell modules (functions
or objects) to do something to, or with, the data. For now think of functions
or objects as simply a packaged series of statements that perform a task. It
might help to think of operators and modules as words you use to create sen-
tences (the statements) that tell the computer what to do. Chapters 4, 5, and
6 cover operators, functions, objects, and modules in detail.
When most people want to learn how to program, they usually focus on the
language. I want to program in C++, for example. Or C++ is a real dog, give
me Java any day. People really do become passionate about languages, and
believe me it is best to keep out of the way when an unstoppable force meets
an immovable object.
What you really should keep in mind, unless computer science is your life, is
that what you want to learn is how to create applications. What makes that
05_522752-ch01.indd 1805_522752-ch01.indd 18 8/27/09 9:45:03 PM8/27/09 9:45:03 PM