Defining a Computer Program


The computer itself speaks in a language of numbersones and zeros. I still find it remarkable all the things that we can do with ones and zeros. For a computer to work with these ones and zeros, it needs to be able to represent them, so it must have a place to store and then find these ones and zeros when it needs them. Then the computer can perform a calculation on them. It can add them together or subtract them or do some combination and come up with more ones and zeros. Ones and zeros are meaningful and they represent meaningful things. In some cases they represent numbers, whereas in other cases they represent letters and words. Basically, we can say that computers can store information and perform calculations on (or process) information.

In a procedural programming language, these two distinct activities are clearly separated. Constants and variables store data and subroutines, and functions perform some kind of calculation on the data. In object-oriented programming, this distinction becomes a little more muddy because a class represents a collection of constants, variables, subroutines, and functions. Whereas constants can refer only to values (known as scalar references), variables can be one of two types: a scalar, which refers to a value, or the variable can be a reference to an object. (An object is an instance of a class; I'll explain this in more detail soon.)

When we say that REALbasic is an object-oriented language, what do we mean? A programmer may tell you that it means that REALbasic isn't a procedural or imperative programming language, and she would be absolutely right. Of course, you might be saying, "So...what does that mean?" The difference between object-oriented programming and procedural programming is twofold. In part, it's a different way of organizing the information and instructions that are used to process it. Procedural programming is a kind of programming that organizes the instructions into modules. It is very much focused on the instructions. Object-oriented programming organizes the instructions and the information into things called classes. These classes describe the instructions and the information that go together to get these tasks done.

REALbasic takes a practical approach to all of this and it incorporates procedural-type programming and object-oriented elements. In its attitude and the terminology used, it's all object-oriented.




REALbasic Cross-Platform Application Development
REALbasic Cross-Platform Application Development
ISBN: 0672328135
EAN: 2147483647
Year: 2004
Pages: 149

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net