Herb Sutter is a recognized expert on C++ software development. Author of more than 150 technical articles and of the widely acclaimed books Exceptional C++ and More Exceptional C++, he regularly gives invited talks to conferences and clients around the world. Herb is secretary of the ISO/ANSI C++ standards committee, contributing editor and columnist for the C/C++ Users Journal and former editor-in-chief of the C++ Report. He currently writes four columns about software development in C++. Visit his Web site at www.gotw.ca. Several weeks ago, Herb joined Microsoft’s Developer Platform and Evangelism Division, where he acts as a liaison between Microsoft and the C++ developer community. DevX’s C++ Pro, Danny Kalev, interviewed Herb Sutter about his new job, the role of C++ in the .NET framework, and the current state of C++.
: Can you describe your new responsibilities as a liaison between Microsoft and the C++ community? Do they include, for instance, direct involvement in the development process of Visual C++? Regular attendance at Microsoft’s newsgroups? Redesigning and re-implementing the core compiler and its libraries?
A: My job definitely includes giving direct input into the feature set for future releases of Visual C++, to make sure that the product has what the C++ community needs.
Note that by “the C++ community,” I mean everyone who works for or with C++, on all compilers and platforms?that includes in-the-trenches systems and application developers, developers of C++ community libraries like Boost and Loki, the C++ standards committee, C++ book and magazine authors, and anyone else plugged into C++.
![]() |
|
When I talk to these people in person at software conferences or committee meetings, or electronically via newsgroups or email, I learn what they need, what they’re trying to accomplish, and what their frustrations and suggestions are about Visual C++ in particular and standard C++ in general. That’s the data it’s my job to distill?to separate patterns from noise, well-thought-out requests from blue-ski wish lists?and bring in a useful form to the Visual C++ team. Clearly standards conformance features are part of what the community needs, as are other features such as usability, like having more readable template error messages and checked STL iterators for debugging.
So, that’s half of my job, bringing external input inside to make Visual C++ a better and even more useful product. That doesn’t just mean doing it myself, because if I’m the only route for community contact, I’d end up as a bottleneck and a checkpoint. Rather, it’s also my job to work to create more openness and community access to Microsoft in general.
The other big part of my job is to see how we can better contribute to the global C++ community. That includes doing things like taking cool and useful libraries developed internally in places like Microsoft Research and contributing them for the community to use, whether that’s by contributing them to community libraries or via MSDN or some other route. That also includes rounding up some of the incredible brain power inside the company and getting those experts to write articles and books that get their great ideas out into view where the community can use them, ideas that can move the C++ world along by having much the same impact as groundbreaking work like Loki.
Some of these things are already happening today. Others are things I’ll be working on over time. You should see the results progressively as I get settled in the role and we move forward to implement all of these things.
Q: What is the first mission on your agenda for the next 2-3 weeks?
A: To ramp and to get settled! Actually, I’m traveling at least two weeks of my first month on the job?speaking at the ACCU conference in England, and then attending the C++ standards meeting in Curacao. Both will let me touch base with important parts of the community?developers, and committee experts and authors?with my new hat on.
Q: What is your response to the claim that Microsoft’s decision to hire a renowned member of the C++ community is a PR stunt that is meant to attenuate the traditional antagonism towards Microsoft?
A: I’ve never heard that. The short answer is that I don’t take on jobs as PR stunts. Neither, I am sure, do people like Stan Lippman and Don Box. We’re at Microsoft because we’re excited about Microsoft’s C++ direction and about .NET.
|
Q: Considering Microsoft’s strong emphasis on C# these days, what is the role of C++ in their .NET Framework?
A: C++ continues to be the dominant language for most kinds of development on Windows. In the .NET world, C++ is still the best-performing language for most development work. The need for a flexible programming language that can handle everything from high-level abstraction to bit-twiddling, all unified within the same language, isn’t going away anytime soon. Other useful programming languages, including C#, will continue to be useful for the kinds of things they’re designed to do. I certainly hope that C# will be the destination of choice for a lot of today’s Visual Basic application developers. That would be quite a step forward. For systems programming, C++ is still tough to beat despite all the naysayers’ wishful thinking that C++ will just roll over and go away. Even in its first incarnation, Managed C++ is the best .NET programming language for creating efficient, performance-oriented applications, and Managed C++ will continue to be improved to increase its overlap with Standard C++.
For about six years now, certain vendors and many so-called industry experts have constantly predicted Java use to overtake C++ use “within two years.” It always seems to be “within two years,” for some reason. I first heard that kind of claim around 1996. Today, six years later, about 3 million of the approximately 9.5 million software developers worldwide use C++. Java still comes in a distant second or third at about 50 percent to 70 percent of the C++ developer numbers, depending on which study you look at.
What’s in Store for C++?Q: It wouldn’t be an exaggeration to say that very little has been done to bring Visual C++ to full ANSI/ISO compliance since the release of Visual C++ 5.0 in 1997. However, Microsoft has recently announced its commitment to bring Visual C++ .NET into compliance with the C++98 standard. What is the cause of this change of heart? When will we have a fully standard-compliant version of Visual C++?
A: Microsoft definitely does intend to ship a fully standard-compliant version of Visual C++. It won’t all be in this next incremental release that we have in early beta right now, but the majority of the conformance improvements will be in there, including partial specialization. It’s certainly conformant enough that the most modern C++ community libraries, particularly Loki, Lamba and Boost, compile in-house without workarounds today. Few shipping compilers on any platform can do that?those libraries are well known as “compiler busters.” Only the strongest compilers can handle them correctly.
Q: Four years have passed since the ratification of the ANSI/ISO C++ standard. In retrospect, it seems that the standardization committee was sometimes hasty to accept dubious features. Namespaces, for instance, seem to be causing more trouble than benefit both to programmers and compiler writers. The new typecast notation, function try blocks, and exception specifications are other examples of such questionable features. Do you agree with this criticism? Are there other features in the C++ standard that you consider superfluous or ill-chosen?
A: I think that’s overstated. Besides, I doubt that a single programming language or software product?or electric toothbrush, for that matter?ever shipped that didn’t have superfluous or ill-chosen features in somebody’s opinion.
As I’ve written recently, it appears that today’s standard exception specifications aren’t very useful in practice (except possibly for the throws-nothing specification). Our experience with export, brief as it is, likewise seems to indicate that it’s a half-baked feature. At the very least, it’s a misunderstood feature. Export doesn’t deliver what most people who are anxiously awaiting it are expecting (to wit, export does not mean that you can ship template libraries without full template source code).
But why invent FUD about other features, like new-style casts? They’re genuinely useful, and I am not aware that anyone has ever questioned their utility. With regards to namespaces, I address this in the closing items of my most recent book, “More Exceptional C++.” Basically, I debunk the camp that urges programmers to always explicitly namespace-qualify all names because it’s bad advice offering little or no real advantage. It just creates useless typing overhead. After all, there’s nothing wrong with the liberal use of using-directives when there aren’t any name ambiguities, and why tell people to always manually resolve names even when there is no name collision to resolve? That doesn’t mean namespaces are broken. How else are you going to distinguish name collisions when two different libraries declare the same name, unless you’re willing to use namespaces or an equivalent disambiguation method? Clearly namespaces, new-style casts, and other such features offer important functionalities and solve real problems, both large and small.
Q: Standard C++ doesn’t support modern programming concepts such as multithreading, distributed computing, components, and persistence. The result is a plethora of proprietary libraries and platform-dependent frameworks that make cross-platform development in C++ nearly impossible. Is Standard C++ still relevant? Which features would you like to see added to the language in the future?
A: Again, these questions arise from an overstated premise. Thousands of companies are routinely writing and shipping cross-platform software written in C++. Claiming that it’s “nearly impossible” doesn’t change the fact that we’ve been doing it for years. The one big area I can think of where portability is genuinely difficult is one the question didn’t mention?GUIs. GUI portability is a problem in all languages, unless you give up writing rich GUIs and write only simple and limited ones. Interestingly, despite some languages’ attempts to “standardize” cross-platform GUI libraries, the best and most successful solution for cross-platform GUIs is not a code library at all, but HTML.
|
The services that these questions address are, of course, important. You can do all of these things whether there is a standardized syntax for them or not. I agree that a standard syntax would be nice and that’s why such things are on the hit list to be added for the next version of the C++ standard.
Q: What is your advice to new C++ programmers? In your opinion, are there other programming languages that C++ programmers should learn?
A: Always learn. Learn from the existing literature, C++ books and magazines and Web articles. They help you avoid reinventing well-known wheels. Learn different languages. They embody different ways of thinking. Learn different tools. They teach different ways of approaching problems. Most language zealots I’ve encountered think that their favorite language is the be-all and end-all, simply because they know few or no other languages. Know the various tools you have available to you, and you can do a much better job of selecting the right tools?plural, not singular?that will help you get your job done today.