Programming is a core activity in the
process of performing tasks or solving problems with the aid of a computer. An idealized
picture is:
Unfortunately things are not (yet) that simple. In
particular, the "specification" cannot be given to the computer using
natural language. Moreover, it cannot (yet) just be a description of the
problem or task, but has to contain information about how the problem is to be
solved or the task is to be executed. Hence we need programming languages.
There are many different programming languages, and many
ways to classify them. For example,
- "high-level" programming languages are languages whose syntax is relatively close to natural language, whereas the syntax of "low-level" languages includes many technical references to the nuts and bolts (0's and 1's, etc.) of the computer.
- "Declarative" languages (as opposed to "imperative" or "procedural" languages) enable the programmer to minimize his or her account of how the computer is to solve a problem or produce a particular output.
- "Object-oriented languages" reflect a particular way of thinking about problems and tasks in terms of identifying and describing the behaviors of the relevant "objects". Smalltalk is an example of a pure object-oriented language. C++ includes facilities for object-oriented programming, as well as for more conventional procedural programming.
Proponents of different languages and styles of languages
sometimes make extravagant claims. For example, it is sometimes claimed that
(well written) object-oriented programs reflect the way in which humans think
about solving problems. Judge for yourselves!
The Origins of C++
C++ was developed by Bjarne Stroustrup of
AT&T Bell Laboratories in the early 1980's and is based on the C Programming language. "++" is a syntactic construct used in C (to
increment a variable), and C++ is intended as an incremental improvement of C.
Most of C is a subset of C++, so that most C programs can be compiled (i.e.
converted into a series of low-level instructions that the computer can execute
directly) using a C++ compiler.
C is in many ways hard to categories. Compared to assembly
language it is high-level, but it nevertheless includes many low-level
facilities to directly manipulate the computer's memory.
It is therefore an
excellent language for writing efficient "systems" programs. But for
other types of programs, C code can be hard to understand, and C programs can
therefore be particularly prone to certain types of error. The extra
object-oriented facilities in C++ are partly included to overcome these
shortcomings.
The American National Standards Institution (ANSI) and the
International Standards Organization (ISO) provide "official" and
generally accepted standard definitions of many programming languages,
including C and C++. Such standards are important. A program written only in
ANSI/ISO C++ is guaranteed to run on any computer whose supporting software
conforms to the standard.
0 comments:
Post a Comment