Bjarne Stroustrup Curated
Danish Computer Scientist
CURATED BY :
Is it important to have a de facto standard for a programming language? What are the advantages? The disadvantages?
A de facto standard is a major advantage to its owner and its owner's friends/allies. It can also benefit third parties, such as professors, students, and small companies. As long as the corporation owning a de facto "standard" is in the process of eliminating alternatives, tools and support tend to be cheap and marketing clout affects the intellectual and business atmosphere. Later, the price goes up
Is there room and/or market demand for a new language in the C family?
I think the user community would be best served by a single language providing low-level support for systems programming. I think C++ would serve well there and I see no technical problems merging C and C++. I see many political problems, though. Vendors/purveyors like a multiplicity of languages and dialects so that they can claim advantages for their variants and lock-in their users. Also, every organization strives to perpetuate itself, so I don't see any of the languages, dialects, and variants dying peacefully.
Are there any important features missing from the C family of languages? From [C++]?
In which sense do C, C++, and Java constitute a family of languages? C and C++ have a large common subset, and over the years serious efforts have been made to minimize the inevitable tendency of the two languages to drift apart because they are controlled by separate standards bodies. Java, however, provides no real compatibility, and similar syntactic constructs have semantics different from the C and C++ versions. Clearly, Java borrows from C and C++, but under the skin, the similarities to Modula-3 seem greater.
In your experience, what are the most common mistakes developers make in [C++]?
Using C++ just as if it was C or Smalltalk. That leads to seriously suboptimal C++. To use C++ well, you have to adopt some native C++ styles. These tend to be distinguished by small concrete classes and templates. A programming style that is overly influenced by C tends to use a lot of arrays, clever pointer manipulation, casts, and macros rather than standard library facilities (such as vectors, strings, and maps). A programming style that is overly influenced by Smalltalk tries to cram every class into a hierarchy and to overuse casts (and often macros). In either case, key abstractions tend to disappear in a mess of implementation details, and people get themselves (unnecessarily) tied in knots with allocation, pointers, casts, and macros.
Did you ever add features that your users didn't appreciate as much as you did, and then have to deprecate or remove them later? What did you learn from the experience?
When I designed C with Classes and C++, I was very keen on the idea that a class defined the environment in which the code of its member functions operate (I still am). This led to the notion of constructors that establish that environment (invariant) and acquire the resources needed. Destructors reverse that process (releasing resources). These ideas are at the root of the design of exceptions and resource management. For example, see the new Appendix E: "Standard-Library Exception Safety" of The C++ Programming Language. That appendix can be downloaded from my home pages
Why has the C family of languages become so successful and so widely used?
C and C++ became popular because they were flexible, cheap, and more efficient than alternatives. C owes much of its initial popularity to the popularity of Unix. C++ owes much of its initial popularity to its high degree of compatibility with C.
What would be your dream setup?
Two pounds, good keyboard, good pen for scribbling and drawing, dockable, running all the major operating systems. Good Internet connection, but able to perform perfectly when disconnected from the web. Able to act as an interface to other systems. Simple and predictable to use. Stable never needs rebooting. Obviously, such a marvel does not exist today.
Could you explain what is the philosophy that the Committee is following to make C++ a more accessible language?
I spend so much time on C++ and its standardization because it is a critical part of many industries: computers, semiconductors, transport, telecom, finance, manufacturing, aerospace, entertainment, and more. Look inside most critical systems and gadgets and you’ll find some C++ inside. That, and being able to help science in a small way, through its software systems, motivates me. C++ is a tool meant to be used for building important artifacts.
Do you listen to music while writing code?
Do you prefer to work at night or the day?
Any newer languages like Rust or Go interest you?
Yeah, I look at new languages roughly all the time. You learn something every time. It is interesting but as I said I’m more of a systems guy than the languages guys. I probably look less at languages than you’d think. I look at what I think is interesting, I try them out but what I really do is to look at what problems do my colleagues and students have and how do I solve them.
What kind of office or work environment do you find relaxing?
Let’s see. For you to work well, you need two things in my opinion. You need good colleagues, good contacts because these things that I’m doing, and I think the things most of us are doing, are just too big for an individual to do by themselves. Furthermore, if you try to do everything by yourself, well you’ll lack feedback. I mentioned Doug McIlroy at Bell Labs; he was absolutely superb at talking to people about problems, and a lot of my best work was done at his blackboard. I need people to talk to, and then I need places to go away and hide when I have to do my own thinking and work. So, I do like an office with a door or my study at home, and I do like some nice music on the earphones, but you need both. Mostly my door is opened; it is only when I have to be in a meeting then I have to close the door, and I can do that without bothering my colleagues, but most of the time the door is open.
You have numerous publications on C++, Is it something you enjoy writing books? Will there be a new edition of “Design and Evolution of C++” to look forward to?
If you build something, you have to write and talk about it. It goes with the territory; otherwise, nobody will be able to use it, and nobody will be able to understand it, and there are writing that’s fun. I loved writing “Design and Evolution” and I love writing the “Tour of C++” book which is an overview. I did not like to write “The C++ Programming Language.” That is a heavy-duty task where there’s a lot of precision a lot of difficulty writing it, but that’s how it worked. I love writing things that can describe some design and motivation. I think that a lot of the literature and a lot of the stuff you find on the web short-changes design ideas. I don’t think I will write a D&E any day soon. That’s sort of backward-looking, and I’m just too busy doing what I think should be put into C++, writing applications, and such. I wrote two papers for the history programming languages conference; ACM SIGPLAN’s conference. The first of those papers was what caused the D&E to be written and there ought to be a fourth HOPL conference in 2022 because so far they have come every 15 years. If that happens, I have definitely thought of writing a 60- or 80-page paper about what had happened to C++ in the last 15 years. Doing so would be useful. It may even be more useful than rewriting D&E because the past design decisions will not have changed, and I will have to describe what had changed. So that might be interesting.
After the initial acceptance of C++. How did you keep your motivation throughout such a monumental task?
Well, I like applications. I like learning about new applications and see C++ being used. I like meeting people who build interesting things and use interesting things and then turning that kind of thing into challenges of design and use. That’s what keeps me going. The applications and people.
What are some events that had a considerable impact on C++’s development?
It is hard to pick individual events. I think that the growth of the PC actually had a major effect. I was working on UNIX systems, of course, that’s my home environment, and we were first starting on a PDP 11/70 which is a shared computer used by 40 researchers or so; the people I mentioned before. We were starting to think about having new small machines; then, they were considered huge. You see, they had a megabyte of memory and a megahertz of processing power and we had to think about what we would do with this absolute abundance of resources. Of course, your cell phone has 4000 times as much today, but I was thinking in terms of how to handle complexity. I was a bit worried about assuming a megabyte but I worked in that environment, and I worked assuming those constraints on what we were doing as opposed to try to build something that was best for the most superb computers then. When IBM came out with PC, IBM PC, and Microsoft had an operating system for, it turned out that it was fairly easy to port C++ to it. For quite a few months I tried to explain to people that it was easy to do, but that I wasn’t interested in doing a port to the PC. When I got tired of explaining that, and so I did it instead so that I could say “yeah yeah yeah, you can port C++ to a PC; I’ve done it.” So wisely I threw my port away so that I didn’t end up maintaining it forever and other people who did implementations. But I think the growth of first the PCs and then the workstation was important. C++ was on Silicon Graphics, graphics machines, later on, games machines. Developments in hardware have been important to C++.
Why did you choose C as the language to add object-oriented features of Simula? There were a few Procedural languages like COBOL, PASCAL to add OO Features. Also, Your favorite language was Algol68?
I knew quite a few languages at the time, maybe 25 or thereabouts. It was easier to learn languages at that time. They were not as big or complicated, and their implementations were not so complicated. Algol68 was quite a beautiful language, very elegant. he reason I chose C was that I needed to manipulate hardware. I needed to write things like schedulers, memory allocators, device drivers. That was not a strength of Algol68, and in general, it’s not a strength of the more elegant languages because the [ability to manipulate] hardware is missing. I had to choose one of the close-to-the-machine languages. There were a few. C seems a pretty good one of them and there was local support at Bell Labs of course. When I was confused about something I could go and ask Dennis or Brian and that’s important. Local support is always important. But the real need was to manipulate hardware directly and efficiently.
Are concerns about technology’s impact on employment valid?
We should always be worried about employment, but we shouldn’t be hung up on employment in one particular task or industry. Technological unemployment is almost complete – 200 years ago most of us were farmers, but everything changes over time. The optimistic view is that automation and AI [artificial intelligence] destroy some kinds of jobs because they get taken over by machines but others open up. Some things we were doing in sweat-shop factories were not very fun, and now some people have gotten better jobs. The question of whether we get more or less good jobs should be asked, but I don’t know the answer. I hope we get more appropriate outlets for people’s talents, but I’m not sure if anyone knows how to do it or predict what will happen as technology becomes more sophisticated.
Where do you see the programming world in the near future?
I think there will be an increasing amount of specialization. That is, application builders will more and more use specialized systems. I think that the world that I tend to live in, which is closer to hardware, where you need performance and dependability, reliability, will be specialized into more classical programming, more demands on system building skills. I think we are going to see many sub-specializations. There are people who think all programming is the same but I disagree, depending on the application constraints and the skills and the individuals, things differ.
What are some of the biggest changes you’ve seen in the developer landscape since C++ was first released?
The first thing that comes to mind is that people these days are much better technicians. They are, however, sometimes not as visionary. Developers and programmers have lost in some sense their willingness to try something new. That’s what I think I’ve seen. Also, there’s a greater appreciation for simplicity.
How important do you think readability is in a programming language?
Oh! it’s immensely important. It’s something I’m working on constantly. Experts want the language to be more expressive. However, for most of us, our knowledge is in most fields, limited, so we need all the help we can get. Actually, one of the themes of the talk I gave yesterday was simplification. The example of how C++ is much simpler than it was 10 or 15 years ago. You can write much shorter programs and much easier-to-read programs and they run just as fast or faster than they used to.
Why should aspiring developers choose to learn C++ to survive in the growing world of computers?
I think because C++ is still close to unique in being able to handle both the low-level and high-level stuff. To handle both the machine and the abstraction. Also, because the subdomain that C++ was designed for, the area C++ was designed for, is bigger than ever. It’s applications that have conflicts and require good use of hardware. That a niche; it’s not everything, and it was never meant to be everything, but it’s bigger than it was when I started. There are currently about four and a half million C++ programmers. A lot of those are in finance because that’s where there are demands on reliability and performance and good response. Similarly, many are in embedded systems, similarly in games. Our cell phones, the lower levels of any cellphone these days, is C++. Quite often some of the higher levels are too because it’s pretty good with power consumption. Compared to the sort of language that requires a lot of indirection and housekeeping, C++ just works better. So basically C++’s niche is bigger than it ever was.
Who did you build the first C++ model for?
I built it for myself, but very soon I had other people using it also. After half a year, I actually got my first non-research user. C++ turned out to be very useful for people very early on. So, I thought it was just for myself, but very soon it wasn’t.
What prompted you to develop C++?
I was a young researcher at Bell Labs and I wanted to study and build a distributed system. For that, I needed a language that could do low-level stuff well: Fast drivers, schedulers, memory management, and such. And I needed something where I could abstract away from the low-level hardware because I wanted a distributed system. I also wanted to use shared memory. Some languages at the time were good at hardware, some were good at abstraction, but there were none that could do both. So, I built one. There were lots of good ideas and good local support for C so I built on that. I knew Simula quite well from my student days, so I knew the power of those abstraction mechanisms. The result turned out to be useful not just for me but also for friends and colleagues.
What's going to be your plans for future C++ programming?
Of course, there are plans for later versions as well, Dr.Stroustrup mentioned executors as potentially sliding to C ++ 23 or even 2026, which essentially act as generic concurrency modules, among other things to support networking functions. If everything goes smoothly, static reflections can also be included in C ++ 23 - however, the development of the language is influenced by many factors, so it would be difficult to say for sure what will be included in the next release. In addition to the new features in C ++ 20, the creator of the language, like the recent Kevlin Henney, we also asked what he thinks about the popularization of the development career, and what he suggests to adults who come to the field from some completely different industry, through some of today's popular adult education services, or even through self-taught methods. Although Dr. Stroutstrup does not have his own experience of a similar shift, as he put it, it is essential to master the basics properly, many make the mistake of wanting to be developers too quickly and cut into practice without seeing how the targeted systems work. So as much time as possible should be devoted to embroidering the funds, of course, it can be difficult for many who are in a hurry to take this advice to move to a new, attractive area - but it is definitely good advice that is accentuated by a great deal of experience.
What tips would you give to a budding programmer?
Programming can be fun, but it is not all fun and games. Our civilization depends on good software. Whatever you are interested in, there will be a use for programming: literature, automobile production, history, coffee making, wind and solar energy, movie making, rocket science, farm management, medicine, science, engineering, and so much more. You might eventually be able to make a significant contribution to whatever field you find important or interesting! To do that you’ll have to know the field and the tools and techniques of software development. Be sure you learn about fundamentals, such as data structures and how machines work. Don’t get overwhelmed, and don’t think you will be an expert in just a few weeks. Think of how long it takes to learn to speak a natural language, how long it takes to become a good athlete, and how long it takes to learn to play an instrument well enough for someone who isn’t your mother to want to listen to. Think about how much fun you can have along the way to reach such mastery and how many friends you might make along the way. Some of the nicest people work with software.
Are there any applications or uses of C++ that you have been especially surprised or excited about?
What amazed me most was the range of applications: from rice cookers to space rockets. It is humbling to realize that just about wherever you look there is C++ involved: cars, movies, games, medicine, finance, computers, farming, etc. I find it most gratifying that C++ has been used in science: the human genome project, the fundamental physics research at CERN and elsewhere, and the Mars Rovers. It feels great to have made a contribution, however small.
If you could go back in time and change one thing about the original implementation of C++, what would it be?
I don’t have a time machine and I shouldn’t try to second-guess 1983-vintage Bjarne—he knew the conditions at the time better than I do now, and any significant change probably wouldn’t have fitted in the 1MB memory I had to work with, and if it had maybe I wouldn’t have been able to port the compiler to an early 640MB Windows machine. But if I could and if realities of compatibility didn’t get in the way, I’d like to eliminate the implicit narrowing and value-changing conversions. They are logically wrong and major sources of errors.