/ INTERVIEWS, C++

Why C++, interview with Herb Sutter

I just listened to a podcast interview with Herb Sutter, by Scott Hanselman, and it is really worth sharing.

You can find Herb's blog post about it here. And the podcast itself is here.

The interview revolves around why C++ is having a resurgence, why it seems a different language from what most people that haven't used it in a while remember, and why it is still heavily used and matters in an age of massive datacenters and mobile computing.

In his blog post Herb mentions some of the topics they discussed, so I though I'd highlight the ones that I enjoyed the most, and add a small comment of my own:

  • 2:00 C++ has changed, but we still call it C++.

In fact, sometimes I find it hard to explain to those not in touch with the current language good practices and techniques, exactly what I am talking about when I talk about C++. Normally I refer to it as modern C++, but the term modern tends to mean different things to different people. It also tends to change with time ... Maybe I'll start referring to it as C++11, altough most of what I currently know was already in use with C++98 (yeah, I'm still getting used to all of the new goodies).

  • 5:30 (Why) do we care about performance any more?

This is an argument that has always annoyed me, even before I started programming. Why would I (as a user) have to upgrade, just to be able to run a program that is not taking advantage of the hardware I have (or is wasting it for tasks that are not useful to me).

This made me strongly identify with one of C++'s design rationales: "only pay for what you use".

The counter argument has always been "computers are getting faster and memory is getting cheaper every day, you shouldn't worry about those details and focus on programmer productivity".

I have to agree with programmer productivity part, but I never accepted that we need to sacrifice hardware resources to do that.

As it turns out, this turned out to be a lot more important as computing shifted from desktops, where you have plenty of power (processing power, and electrical power), to datacenters (where you need to worry about power consumption, heat dissipation, etc) and mobile applications (where if you are not efficient, battery life is going to take a big hit).

I have to say I loved Herb's counter argument of "your Mom doesn't care how good your battery is, she cares how long it lasts".

  • 13:45 C++ is having a resurgence. Where is C++ big?

Herb mentions that C/C++ (the Visual C++ team) is the only team at microsoft that affects all others. All others depend on it.

He also talks about Andrei Alexandrescu working at Facebook, and their gradual move from php to C++ (see hiphop in github and at facebook)

I have to mention, there are a lot more examples of this dependency on C++ (to several degrees). Apple, Google, etc.

  • 18:00 Why not just use one language? or, What is C++ good at? Efficient abstraction and portability.

Here I hear, confirmed by a C++ guru, what I keep saying. C/C++ is more portable than most people think. If you want to target multiple platforms, specifically mobile, you can write all of the logic in C/C++, and just have to take care of the specific platform details, in particular the GUI.

Scott mentions that this has been done in Mono (.net) without the need to rewrite anything.

I have to say I love being able to reuse more code, but have grown to dislike GUIs that do not conform with the look and feel of the platform they are running on.

rui

Rui Pires

Working as a professional full time remote developer from the Azores since 2011.

Read More