The history of C++ (Bjarne Stroustrup)
‘‘A programming language serves two related purposes: it provides a vehicle for the programmer to specify actions to be executed and a set of concepts for the programmer to use when
Thinking about what can be done. The first aspect ideally requires a language that is ‘‘close to the machine.
The second aspect ideally requires a language that is ‘‘close to the problem to be solved.
’’
History of C++
C was developed after the language called B (designed by Ken Thompson in 1970). Which itself came from another language called BCPL (Basic Combined Programming Language), developed by Martin Richards.
B got its start on a UNIX operating system, so when C was released, it was still used in a UNIX environment. Two years after C was released, the code written in C began to suffer some setbacks. One of the setbacks was the inability of programmers to harness the power of the personal computer without the software growing more complex and longer.
In 1983, Bjarne Stroustrup at Bell Labs developed a solution and named it the C++ programming language. He drew inspiration from some of the previous languages that allowed object-oriented programming, such as Simula67. In addition to other features of C,C++ provides capabilities for object-oriented programming.
The explicit aim, according to Bjarne, was to match C in terms of runtime, code compactness, and data compactness.” This quote highlights the goal of C with Classes: to maintain the efficiency of C while improving the organization of programs. It shows the importance placed on not sacrificing run-time performance for improved program structure.
The features provided in the initial 1980 implementation can be summarized as follows:
[1] classes,
[2] derived classes,
[3] public/private access control,
[4] constructors and destructors,
[5] call and return functions (§2.4.8),
[6] friend classes,
[7] Type checking and conversion of function arguments
During 1981, three more features were added:
[8] inline functions,
[9] default arguments,
[10] overloading of the assignment operator
Early programming languages such as FORTAN, ,BASIC and C, referred to as procedural programming languages, were focused on actions (verbs) rather than things or objects (nouns). A key problem with these languages is that program units do not easily mirror real-world entities effectively, so these units are not particularly reusable. Thus,programmers usually start each program from scratch even when similar software has been developed.
Conversely, an object (an abstraction of a problem) is essentially a reusable software component that models items in the real world. This concept gave rise to object programming. Object-oriented programming facilitates the development of software products that are easier to understand,better organized, easier to maintain and debug, and easier to modify. C++, however, has the features of traditional C and Simula 67’s capabilities of creating and managing objects. It is therefore said to be a hybrid language, that is, it is possible to program in C++ in either a C-like style or an object-oriented style, or both.
Why C?
A common question at C with Classes presentations was ‘‘Why use C? Why didn’t you build on, say, Pascal?’’
‘‘C is clearly not the cleanest language ever designed nor the easiest to use, so why do so many
People use it?
[1] C is flexible: It is possible to apply C to most every application area and to use most
Every programming technique with C The language has no inherent limitations that
Preclude particular kinds of programs from being written.
[2] C is efficient: The semantics of C are ‘‘low level, that is, the fundamental concepts of
mirror the fundamental concepts of a traditional computer. Consequently, it is relatively easy for a compiler and/or a programmer to efficiently utilize hardware resources.
For a C program.
[3] C is available: Given a computer, whether the tiniest micro or the largest super,
Computer, the chance is that there is an acceptable-quality C compiler available and that
That C compiler supports an acceptably complete and standard C language and library.
There are also libraries and support tools available, so a programmer rarely needs to
Design a new system from scratch.
[4] C is portable: A C program is not automatically portable from one machine (and operating system) to another, nor is such a port necessarily easy to do. It is, however, usually
possible, and the level of difficulty is such that porting even major pieces of software
With inherent machine dependence, it is typically technically and economically feasible.
Feature Details
Clearly, the most important aspect of C with classes—and later of C++—was the class concept.
Many aspects of the C with Classes class concept can be observed by examining a simple example from [Stroustrup, 1980a]:
Class stack {
Char s[SIZE]; /* array of characters */
Char * min; /* pointer to bottom of stack */
Char * top; /* pointer to the top of the stack */
Char * max; /* pointer to the top of the allocated space */
Void new(); /* initialization function (constructor) */
Public:
Void push(char);
Char pop();
};
A class is a user-defined data type. A class specifies the type of class members that define the
The representation of a variable of the type (an object of the class) specifies the set of operations.
(functions) that manipulate such objects, and specifies the access users have to these members.
Member functions are typically defined ‘‘elsewhere:’’
Char stack.pop()
{
If (top <= min) error(“stack underflow”);
Return *(−−top);
}
Objects in the class stack can now be defined and used.
Books written or cowritten by Bjarne Stroustrup
- A Tour of C++ by Bjarne Stroustrup, Addison-Wesley Professional, 2013. Its ISBN is 978-0321958310.
- Programming: Principles and Practice Using C++ by Bjarne Stroustrup, Addison-Wesley Professional, 1st edition (December 29, 2008); Its ISBN is 0-321-54372-6.
- The C++ Programming Language, by Bjarne Stroustrup, Addison-Wesley Pub Co., 4th edition (May 23, 2013); Its ISBN is 0-321-563840.
- The Design and Evolution of C++, by Bjarne Stroustrup, Addison-Wesley Pub Co., 1st edition (March 29, 1994); Its ISBN is 0-201-54330-3.
- The Annotated C++ Reference Manual by Margaret A. Ellis and Bjarne Stroustrup, Addison-Wesley Pub Co. (1 January 1990); Its ISBN is 0-201-51459-1. This book received Dr. Dobb’s “Jolt Cola” award for excellence in technical documentation.
Great work!
ReplyDelete