Big Think Interview With Bjarne Stroustrup
Bjarne Stroustrup is a computer programmer most famous for having designed and implemented the computer programming language C++, one of the most widely used programming languages in the world. His book "The C++ Programming Language" is the most widely read book of its kind and has been translated into at least 19 languages. In addition to his five books, Stroustrup has published hundreds of academic and popular papers. He currently holds the College of Engineering Chair in Computer Science at Texas A&M University.
Question: What inspired you to create C++?
Bjarne Stroustrup: In the really old days, people had to write their code directly to work on the hardware. They wrote load and store instructions to get stuff in and out of memory and they played about with bits and bytes and stuff. You could do pretty good work with that, but it was very specialized. Then they figured out that you could build languages fit for humans for specific areas. Like they built FORTRAN for engineers and scientists and they built COBALT for businessmen.
And then in the mid-'60s, a bunch of Norwegians, mostly Ole-Johan Dahl and Kristen Nygaard thought why can’t you get a language that sort of is fit for humans for all domains, not just linear algebra and business. And they built something called SIMULA. And that’s where they introduced the class as the thing you have in the program to represent a concept in your application world. So if you are a mathematician, a matrix will become a class, if you are a businessman, a personnel record might become a class, in telecommunications a dial buffer might become a class—you can represent just about anything as a class. And they went a little bit further and represented relationships between classes; any hierarchical relationship could be done as a bunch of classes. So you could say that a fire engine is a kind of a truck which is a kind of a car which is a kind of a vehicle and organize things like that. This became know as object-oriented programming or also in some variance of it as data abstraction.
And my idea was very simple: to take the ideas from SIMULA for general abstraction for the benefit of sort of humans representing things... so humans could get it with low level stuff, which at that time was the best language for that was C, which was done at Bell Labs by Dennis Ritchie. And take those two ideas and bring them together so that you could do high-level abstraction, but efficiently enough and close enough to the hardware for really demanding computing tasks. And that is where I came in. And so C++ has classes like SIMULA but they run as fast as C code, so the combination becomes very useful.
Question: What makes C++ such a widely used language?
Bjarne Stroustrup: If I have to characterize C++’s strength, it comes from the ability to have abstractions and have them so efficient that you can afford it in infrastructure. And you can access hardware directly as you often have to do with operating systems with real time control, little things like cell phones, and so the combination is something that is good for infrastructure in general.
Another aspect that’s necessary for infrastructure is stability. When you build an infrastructure it could be sort of the lowest level of IBM mainframes talking to the hardware for the higher level of software, which is a place they use C++. Or a fuel injector for a large marine diesel engine or a browser, it has to be stable for a decade or so because you can’t afford to fiddle with the stuff all the time. You can’t afford to rewrite it, I mean taking one of those ships into harbor costs a lot of money. And so you need a language that’s not just good at what it’s doing, you have to be able to rely on it being available for decades on a variety of different hardware and to be used by programmers over a decade or two at least. C++ is now about three decades old. And if that’s not the case, you have to rewrite your code all the time. And that happens primarily with experimental languages and with proprietary commercial languages that change to finish... to meet fads.
C++’s problem is the complexity partly, because we haven’t been able to clean it up. There’s still code written in the '80s that are running and people don’t like their running codes to break. It could cost them millions or more.
Question: What is the difference between C and C++?
Bjarne Stroustrup: C has the basic mechanisms for expressing computations. It has iterations, it has data types, it has functions and that’s it. It doesn’t get into the game of expressing abstractions. So if I want a matrix in C, I would have to say, I want an array and then I want a whole bunch of arrays and when I want to get the third element I have to program my way down to the third element of the fourth row or something like that.
In C++ you can define something, call it a matrix, you define a subscript operator. If you don’t want rectangular matrixes you can get pentadiagonal matrices, triangular matrices that’s the kind of stuff that people... the expert in that field are interested in. And you build that set of concepts and then you program it directly. It’s easier to program, it’s easier to debug and sometimes it’s even easier to optimize for performance when you are expressing the notions at the higher level, at the level where an expert in the field operates, rather than trying to have the expert in the field, say the physicist, also be an expert in dealing with the hardware, with the computer. There are fields still where you have to have a physicist and a computer scientist to get the work done, but we would like to minimize those because the skill sets are not the same. So you want to lift from the hardware towards the human level.
Question: Is C obsolete?
Bjarne Stroustrup: This is somewhat controversial. I think it is obsolete. I think the languages should have been merged into one, so that C would have been a subset of C++ instead of nearly a subset of C++. And then people could have used whatever parts of the C++ tool set they needed. As it is now, there are still enough incompatibilities that you have to remember which language you’re writing in, and I don’t think that is necessary. It appears to be a historical necessity, but it is not a technical necessity.
I’ve argued for compatibility, very strong compatibility, all the time. I mean, I started working on C++ three doors down from Dennis Ritchie and we were talking every day. The competition and tension that has been between C and C++ over the decades certainly didn’t come from home.
Dennis Ritchie wrote that first book that Brian Carnahan, now I’ll have dinner with Brian next week. We’re still very good friends as we’ve always been, but sometimes the programmers of the languages don’t quite see it that way. It should have been one language.
Question: What is the future of programming?
Bjarne Stroustrup: There’ll be a unified language, but I’m not talking about programming language. I’m talking more about a unified design style, a unified set of guidelines for how to combine the techniques. I certainly hope that there will not be just one programming language. I don’t think that’s at all likely and I would be sad because we would have lost a lot when we don’t have this tension between the languages that allows us to make progress. I mean, the middle ages may have been very comfortable, but I don’t think I would have wanted to live there. I like the diversity of ideas and the early ideas rubbing up against each other. That’s how we make progress.
Question: Are you a proponent of open source software?
Bjarne Stroustrup: I am generally in favor of open source software with very few, if any, restrictions. So I like the BSD Licenses. I am not anti-commercial. I would not put something into my license that would be a virus against commercial use.
On the other hand, I don’t think that all software can or should be open because there’s a lot of sort of boring stuff that requires a high level of expertise to deal with. I mentioned sort of the firmware layers and hardware and such. There’s very few people that really understand it. You don’t get it maintained by a couple of volunteers because you need maybe five, 10 years experience in a particular field to do anything constructive and there’s lots and lots of software that’s not glamorous, that’s not interesting where you’ll simply not get the strength of the open source movement where you have lots of people, lots of contributions both individuals and organizations. But there’s a lot of software where people just aren't interested. And for that you need something else to keep it going and that’s usually the dollars that people get for doing the hard, sometimes boring, and sometimes advanced stuff. So I think we always will have open source software and some closed.
I guess I should add that C++ is used to both anyways, so. I don’t have a... I don’t have a horse in that race, so I have both.
Question: What are the five most important languages that programmers should know?
Bjarne Stroustrup: First of all, nobody should call themselves a professional if they only knew one language. And five is a good number for languages to know reasonably well. And then you’ll know a bunch, just because you’re interested because you’ve read about them because you’ve wrote a couple of little programs like [...]. But five isn’t a bad number. Some of them book between three and seven.
It would be nice beyond that to know something quite weird outside it just to have an experience, pick one of the functional languages, for instance, that’s good to keep your head spinning a bit when it needs to. I don’t have any favorites in that field. There’s enough of them. And, I don’t know, if you’re interested in high-performance numerical computation, you have to look at one of the languages there, but for most people that’s just esoteric.
Question: What are the most interesting trends in technology?
Bjarne Stroustrup: Many things are interesting these days. The interesting thing for me is the computers they have inside it. And so when you see things, cars driving down there, planes flying and such, you can see them as a distributed computing system with wings or distributed computing system with wheels.
I was over in Germany earlier in the year to speak to the German automotive software conference. And I don’t know much about programming cars, but I got an invitation to go down and see how they programmed the BMWs, which is C++, so that'll be interesting. Not that the other weren’t, but those are cool cars. And I’ve worked with some people up at Lockheed Martin where they build the F-35s, the new fighter planes, which is C++ also. So I get some insight in how things are used.
And so at the bottom of all of this is the technology of the hardware, there’s the technology of the communications stuff between it, networking, and on the hardware side what has happened a lot is the multi-cores. You get concurrent programming both from the physical distribution and for the... what’s under the chip themselves. And this is interesting to me because my PhD topic was distribution and concurrency and such. So I’ve been looking at that. So that’s interesting.
And a lot of the most interesting applications these days fall into that category. Take our cell phones: the last time I looked there are several processes. Take a single... take an SLR camera, it’s got five or six processors in it and the cobble in the lenses, I mean, that's some interesting code there. And so whether you think of that as technology or gadgets. I think of them as a gadget. I mean a cell phone or a new jetliner, they’re gadgets. They are things you program and there’s programs in it, there’s techniques, lots of computers.
What I haven’t talked about much about, and what I don’t think that much about is sort of the web kind of thing and the web business. From my perspective, that’s somebody else’s business except when the scale becomes really huge. So you have things like the Google search engines with C++ and I get interested, they get interested. Facebook has recently turned to C++ because they needed the performance. I guess in some way of saying here’s my contribution to dealing with global warming because if you can double the efficiency of those systems, you don’t need yet another server farm that uses as much energy as a small town.
So my view is that there's software and there’s computers in just about everything and if you look at interesting things, well, you find it.
Question: What is your work setup like?
Bjarne Stroustrup: I travel with a little laptop, the smallest real computer I can get. So the 12-and-something screen and... but a decent processor speed. And where I am, I plug it into a dock and I use two screens and such and then I network to any other resources I want. If at all possible, I would like to make that machine smaller, but... or at least lighter. Larger and lighter would be nice, but I don’t get it and too light if you’re stuck in a sardine-class seat on a plane, you still should be able to open up and write. And you can’t do that with one of those bodybuilder’s editions. So a smaller machine, convenient machine that you can carry with you and plug it into a bigger system network to more resources.
My laptop is a Windows. People always ask that. And they can’t understand why it’s not my Linux. Well, my Linux happens to sit on my desk and it talks to a traditional Unix through it. So I use both on a daily basis. It just happened that it’s easier to carry the Windows books around.
Question: Do you prefer to work at night or during the day?
Bjarne Stroustrup: Real thinking, real work goes on fairly early in the day. And then in the evening, no, not really sort of thought work, not creative work. I can polish stuff. I’m not a night bird like that. I like to think when I’m fresh.
Question: Do you listen to music while writing code?
Bjarne Stroustrup: Quite often, yes. I have a mixture of stuff on the computer; I just plug in the earphones and listen. And there’s a mixture, there’s classical, there’s a bit of rock, there’s a bit of country. It’s quite surprising what I can actually work with and what I can’t because it really does affect it. There’s music that sort of takes over and you think about the music, rather than the code. That’s no good. And then there’s music that you don’t hear... that doesn’t help either. And well, so well I found something that works, probably just for me, but I like some music.
Question: What advice do you have for C++ developers?
Bjarne Stroustrup: Most people don’t use C++ anywhere near as well as it could be used. There are still a lot of people that are trying to use it as a glorified C, or as a slightly mutated Java or SmallTalk, and that’s not the right way of using it. Go back, read one good book and see if you are up to date or if you happen to be stuck in the '80s or '90s. We can do much better. And then, next year, C++ OX will arrive, the next generation of C++ and it’ll support some of the modern programming styles that has been proven useful over the last decade or so—significantly better than C++ 98, which was the previous standard. And so learn a little bit about it, look at what has been done and try to understand why it was done. Things are just about to get much better.
Recorded August 12, 2010
Interviewed by Max Miller
A conversation with the creator of C++.
Once a week.
Subscribe to our weekly newsletter.
Context is everything.
The COVID-19 pandemic has introduced a number of new behaviours into daily routines, like physical distancing, mask-wearing and hand sanitizing. Meanwhile, many old behaviours such as attending events, eating out and seeing friends have been put on hold.
A new study looks at how images of coffee's origins affect the perception of its premiumness and quality.
- Images can affect how people perceive the quality of a product.
- In a new study, researchers show using virtual reality that images of farms positively influence the subjects' experience of coffee.
- The results provide insights on the psychology and power of marketing.
Evolution doesn't clean up after itself very well.
- An evolutionary biologist got people swapping ideas about our lingering vestigia.
- Basically, this is the stuff that served some evolutionary purpose at some point, but now is kind of, well, extra.
- Here are the six traits that inaugurated the fun.
The plica semilunaris<img class="rm-lazyloadable-image rm-shortcode" type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8xOTA5NjgwMS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTY3NDg5NTg1NX0.kdBYMvaEzvCiJjcLEPgnjII_KVtT9RMEwJFuXB68D8Q/img.png?width=980" id="59914" width="429" height="350" data-rm-shortcode-id="b11e4be64c5e1f58bf4417d8548bedc7" data-rm-shortcode-name="rebelmouse-image" />
The human eye in alarming detail. Image source: Henry Gray / Wikimedia commons<p>At the inner corner of our eyes, closest to the nasal ridge, is that little pink thing, which is probably what most of us call it, called the caruncula. Next to it is the plica semilunairs, and it's what's left of a third eyelid that used to — ready for this? — blink horizontally. It's supposed to have offered protection for our eyes, and some birds, reptiles, and fish have such a thing.</p>
Palmaris longus<img class="rm-lazyloadable-image rm-shortcode" type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8xOTA5NjgwNy9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTYzMzQ1NjUwMn0.dVor41tO_NeLkGY9Tx46SwqhSVaA8HZQmQAp532xLxA/img.jpg?width=980" id="879be" width="1920" height="2560" data-rm-shortcode-id="4089a32ea9fbb1a0281db14332583ccd" data-rm-shortcode-name="rebelmouse-image" />
Palmaris longus muscle. Image source: Wikimedia commons<p> We don't have much need these days, at least most of us, to navigate from tree branch to tree branch. Still, about 86 percent of us still have the wrist muscle that used to help us do it. To see if you have it, place the back of you hand on a flat surface and touch your thumb to your pinkie. If you have a muscle that becomes visible in your wrist, that's the palmaris longus. If you don't, consider yourself more evolved (just joking).</p>
Darwin's tubercle<img class="rm-lazyloadable-image rm-shortcode" type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8xOTA5NjgxMi9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTY0ODUyNjA1MX0.8RuU-OSRf92wQpaPPJtvFreOVvicEwn39_jnbegiUOk/img.jpg?width=980" id="687a0" width="819" height="1072" data-rm-shortcode-id="ff5edf0a698e0681d11efde1d7872958" data-rm-shortcode-name="rebelmouse-image" />
Darwin's tubercle. Image source: Wikimedia commons<p> Yes, maybe the shell of you ear does feel like a dried apricot. Maybe not. But there's a ridge in that swirly structure that's a muscle which allowed us, at one point, to move our ears in the direction of interesting sounds. These days, we just turn our heads, but there it is.</p>
Goosebumps<img class="rm-lazyloadable-image rm-shortcode" type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8xOTA5NzMxNC9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTYyNzEyNTc2Nn0.aVMa5fsKgiabW5vkr7BOvm2pmNKbLJF_50bwvd4aRo4/img.jpg?width=980" id="d8420" width="1440" height="960" data-rm-shortcode-id="8827e55511c8c3aed8c36d21b6541dbd" data-rm-shortcode-name="rebelmouse-image" />
Goosebumps. Photo credit: Tyler Olson via Shutterstock<p>It's not entirely clear what purpose made goosebumps worth retaining evolutionarily, but there are two circumstances in which they appear: fear and cold. For fear, they may have been a way of making body hair stand up so we'd appear larger to predators, much the way a cat's tail puffs up — numerous creatures exaggerate their size when threatened. In the cold, they may have trapped additional heat for warmth.</p>
Tailbone<img class="rm-lazyloadable-image rm-shortcode" type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8xOTA5NzMxNi9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTY3MzQwMjc3N30.nBGAfc_O9sgyK_lOUo_MHzP1vK-9kJpohLlj9ax1P8s/img.jpg?width=980" id="9a2f6" width="1440" height="1440" data-rm-shortcode-id="4fe28368d2ed6a91a4c928d4254cc02a" data-rm-shortcode-name="rebelmouse-image" />
Image source: Decade3d-anatomy online via Shutterstock<p>Way back, we had tails that probably helped us balance upright, and was useful moving through trees. We still have the stump of one when we're embryos, from 4–6 weeks, and then the body mostly dissolves it during Weeks 6–8. What's left is the coccyx.</p>
The palmar grasp reflex<img class="rm-lazyloadable-image rm-shortcode" type="lazy-image" data-runner-src="https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8xOTA5NzMyMC9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTYzNjY0MDY5NX0.OSwReKLmNZkbAS12-AvRaxgCM7zyukjQUaG4vmhxTtM/img.jpg?width=980" id="8804c" width="1440" height="960" data-rm-shortcode-id="67542ee1c5a85807b0a7e63399e44575" data-rm-shortcode-name="rebelmouse-image" />
Palmar reflex activated! Photo credit: Raul Luna on Flickr<p> You've probably seen how non-human primate babies grab onto their parents' hands to be carried around. We used to do this, too. So still, if you touch your finger to a baby's palm, or if you touch the sole of their foot, the palmar grasp reflex will cause the hand or foot to try and close around your finger.</p>
Other people's suggestions<p>Amir's followers dove right in, offering both cool and questionable additions to her list. </p>
Fangs?<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">Lower mouth plate behind your teeth. Some have protruding bone under the skin which is a throw back to large fangs. Almost like an upsidedown Sabre Tooth.</p>— neil crud (@neilcrud66) <a href="https://twitter.com/neilcrud66/status/1085606005000601600?ref_src=twsrc%5Etfw">January 16, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Hiccups<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">Sure: <a href="https://t.co/DjMZB1XidG">https://t.co/DjMZB1XidG</a></p>— Stephen Roughley (@SteBobRoughley) <a href="https://twitter.com/SteBobRoughley/status/1085529239556968448?ref_src=twsrc%5Etfw">January 16, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Hypnic jerk as you fall asleep<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">What about when you “jump” just as you’re drifting off to sleep, I heard that was a reflex to prevent falling from heights.</p>— Bann face (@thebanns) <a href="https://twitter.com/thebanns/status/1085554171879788545?ref_src=twsrc%5Etfw">January 16, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p> This thing, often called the "alpha jerk" as you drop into alpha sleep, is properly called the hypnic jerk,. It may actually be a carryover from our arboreal days. The <a href="https://www.livescience.com/39225-why-people-twitch-falling-asleep.html" target="_blank" data-vivaldi-spatnav-clickable="1">hypothesis</a> is that you suddenly jerk awake to avoid falling out of your tree.</p>
Nails screeching on a blackboard response?<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">Everyone hate the sound of fingernails on a blackboard. It's _speculated_ that this is a vestigial wiring in our head, because the sound is similar to the shrill warning call of a chimp. <a href="https://t.co/ReyZBy6XNN">https://t.co/ReyZBy6XNN</a></p>— Pet Rock (@eclogiter) <a href="https://twitter.com/eclogiter/status/1085587006258888706?ref_src=twsrc%5Etfw">January 16, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Ear hair<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">Ok what is Hair in the ears for? I think cuz as we get older it filters out the BS.</p>— Sarah21 (@mimix3) <a href="https://twitter.com/mimix3/status/1085684393593561088?ref_src=twsrc%5Etfw">January 16, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Nervous laughter<blockquote class="twitter-tweet" data-lang="en"><p lang="en" dir="ltr">You may be onto something. Tooth-bearing with the jaw clenched is generally recognized as a signal of submission or non-threatening in primates. Involuntary smiling or laughing in tense situations might have signaled that you weren’t a threat.</p>— Jager Tusk (@JagerTusk) <a href="https://twitter.com/JagerTusk/status/1085316201104912384?ref_src=twsrc%5Etfw">January 15, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Um, yipes.<blockquote class="twitter-tweet" data-conversation="none" data-lang="en"><p lang="en" dir="ltr">Sometimes it feels like my big toe should be on the side of my foot, was that ever a thing?</p>— B033? K@($ (@whimbrel17) <a href="https://twitter.com/whimbrel17/status/1085559016011563009?ref_src=twsrc%5Etfw">January 16, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
Research has shown how important empathy is to relationships, but there are limits to its power.
- Empathy is a useful tool that allows humans (and other species) to connect and form mutually beneficial bonds, but knowing how and when to be empathic is just as important as having empathy.
- Filmmaker Danfung Dennis, Bill Nye, and actor Alan Alda discuss the science of empathy and the ways that the ability can be cultivated and practiced to affect meaningful change, both on a personal and community level.
- But empathy is not a cure all. Paul Bloom explains the psychological differences between empathy and compassion, and how the former can "get in the way" of some of life's crucial relationships.