Programming Languages (CS302 2006S)

Notes on Stroustrup

Comments on:

Stroustrup, B. Some random video.

Comments from: Peter Brown, Michael Claveria, Davis Hart, Alex Leach, Brad Miller, Angeline Namai (*), Mark Nettling, Dave Ventresca.

No Comments from: Dimitar Tasev (x).

He posited that a programming language is a response to a particular set of problems. This, combined with his stated goal of creating C++ to be useful for problems/computers of the time, suggests to me that C++'s existance might be time-sensitive and that it will or already has become obsolete.

He focused a lot on enhancing the organization of programs through the design of a language. I've thought that the pure-OO focus of Java makes it inappropriate for smaller applications and/or those which might be better suited by an iterative or other non-OO langauge. The approach of C++ of providing an OO interface as well as allowing iterative programming makes sense to span multiple types of problems and be a language applicable to an array of different types of problems

What does he mean by calling Lisp or Simula a "complete programming language"? It sounds like by "complete programming language" he means one with some type of GUI, IDE, or other add-on...

I'm not sure that he said complete programming language. He was referring to languages, like Smalltalk and Oberson, in which there is no distinction between the language and the user environment.

I hadn't heard about C with classes before this video and I thought the progression from C to C with Classes to C++ was interesting, especially how the whole thing evolved to solve a personal engineering problem of his.

The admittance that C++ was never intended to be a perfect language was interesting. I think that his idea that no one should strive for a "perfect language" is very important.

Lastly, I think it is interesting how many people think of C++ as one of the first real object-oriented languages but Stroustrup claims that the language is supposed to be a multiple paradigm language.

I thought it was interesting that C++ was more a continuation of "C with classes" instead of just straight from C.

Why didn't Stroustrup provide for more secure error-checking the way Java does?

Because he didn't want to get in the way of the programmer.

I couldn't find a clear goal for why Stroustrup created C++.

See the long answers below.

History: Stroustrup was motivated to create C++ while he was writing simulators for operating systems for his PhD thesis. He was initially programming in Simula, as it was the natural language of choice for programming that involved simulation. He liked the support for user-defined types, the strong type-checking, and the object-oriented organization, but was disappointed that it did not run as fast. He turned to BCPL, an ancestor of C, whose fast-running simulator appealed, but which felt too much like a machine language. Given that he was working with systems, and that C was the dominant systems language, he decided to use C as the framework upon which he could make some improvements. He intended to preserve C's efficiency and portability, but was aiming toward an object-oriented language that supported data abstraction and simulation, and involved zero overhead. He then combined the powerful features of each of the three languages to produce C with Classes, what is now C++.

Intended audience: C++ was intended for those in system programming, distributive systems and networking, and was therefore an industrial language, as opposed to an academic one. However, C and Fortran were the preferred languages of those in industry, so layout compatibility and coexistence with these languages were important factors in Stroustrup's design. He was concerned about a smooth transition, and for this reason, he chose not to deviate too far from the C syntax in order to provide a somewhat direct mapping from C to C++. Coexistence enabled the gradual replacement of the old languages' implementations with that of the new one, and was an effective means to compare the performance of the new and existing languages.

I like that Stroustrup admitted that C++ was not designed to be the perfect language, but to be a language that would solve the problems of his time. According to him, the quest for the perfect language is "sterile," since the programmer's idea of perfection changes over time. I found this to be an echo of Tate, who claims that Java's days as the favorite language are soon to be over seeing that programmers' needs are slowly shifting away from the Java world. I was surprised, however, when Stroustrup mentioned that reuse was not a primary aim of the language. Given that C++ was intended for use in big systems, wouldn't reuse be a major factor? Besides, C++ is supposed to be an object-oriented language, and all three key ideas of OOP seem to place much emphasis on reuse, so doesn't Stroustrup's decision reduce the power of C++ as an OOPL? He may have answered my question toward the end of the video, but we did not get to see it all, since it was over an hour-long.

The video was very awkward to be honest. I felt like he knew what he was talking about, and that he was very smart, but he was not able to transfer much of that knowledge on to me. I did understand that he was was saying that C++ made programming easier by way of using objects. He said that the objects made it easier to maintain and manipulate data, which I agree with. I would like a clarification on how operation overloading works, because I was not able to understand how his example worked (the example with complex numbers). Overall, I would say that the video was not really useful to me as I was not able to learn much, and that the Java video was more interesting.

What is the difference between C with Classes and C++? He talks about both, but never really makes clear the distinction between them. Is C with Classes just the first version or...?

Stroustrup developed C with Classes first. After observing some problems with it, he developed C++.

I did not understand what he was talking about with 'linking' conventions and not wanting to write his own because it's too time consuming. What are they?

When you work in languages like C, you typically generate an object-code file for each source-code file. You must then join all the pieces of object-code together (along with libraries and the ilk) into an executable. That joining often moves things around (after all, each bit of object code is unlikely to know about the rest, so can't place itself in memory) and resolves calls to the right address. In a dynamically linked system, you can bring in new code on the fly.

Stroustrup mentioned the "impossibility of a perfect language" due to the evolution of what is desired in the CS/Programming community. I agree that there probably won't ever be The Perfect Language for every task, however I do think that it's possible to have perfect languages for certain tasks. I'm not sure where I'm going with this...I just think that he's wrong to condemn programming languages to a fate of never reaching perfection.

He lost half of his hair debugging a program during his senior year in grad school at Cambridge.

One of the goals in the creation of C++ was that he wanted it to be competitive but also co-exist with other languages.

I also learned that C++ is basically C but with better support for objects.

You can do without the better. C has no built-in objects.

I also learned that simula and BCPL are ancestors of C that make C look like a high level language.

Simula does not make C look like a high-level language. BCPL does. Simula looks a lot like Pascal.

When designing C++ the guy chose C because it was effecient portable and well known.

He is also a great fan of static type checking and didn't want to reinvent every wheel, just some of them.

He also believes that the possibilities of reuse come not from the design of the language but from well thought out design of a program.

Computer scientists must learn to not make movies about a programming language

If someone makes a lecture into a movie, he should look into the camera while delivering the lecture

Bjarne Stroustrup seems to be lacking in the social skills department and is a pretty boring speaker.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Wed May 10 09:03:22 2006.
The source to the document was last modified on Wed Mar 15 09:56:42 2006.
This document may be found at

You may wish to validate this document's HTML ; Valid CSS! ; Check with Bobby

Samuel A. Rebelsky,