Interview With Herb Sutter
Anonymous Coward writes "Herb Sutter, a C++ luminary, recently joined Microsoft's Developer Platform and Evangelism Division, where he acts as a liaison between Microsoft and the C++ developer community. In this interview he speaks about his new job, the role of C++ in the .NET framework, and the current state of C++."
No mention of IA64, or X86-64 =( I'm really curious to know if compilers will be in place to exploit these platforms, ESPECIALLY IA64.
-Berj
(hyperthreading, too?)
MS made a smart move hiring one of the most famous C++ guru, and moderator of "Guru of the week" (GotW, here).
(The Exceptional C++ books are selections from the GoW series).
I really think that this will enhance the MS' C++ offer quality, and including the GotW thinkabout in its future design is a kind of "bazaar" approach!... Funny!
667 The Neighbour of the Beast
An interesting point he makes about HTML being the best means for a cross platform interface for programs, C++ or otherwise.
.NET language suite is quite a suprise to me since I though C# got most development focus when creating the new tech.
I think he's right.
Also C++ being the best performing language in the
Rys
- 'sup, G?
Please check the GotW site (here).
Here you can really check if you are a C++ expert. For instance, from the first Excexptional C++ book (here) you can find one of the deepest thinking about "exception safety".
Beleive me, I know tons of experienced C++ coders who don't know that a method who simply makes if-then-else and cout something on then and else branches can end in more than 20 different execution paths! (the topic is quite big, check the book... trust me, it's worth!)
667 The Neighbour of the Beast
how to write a C++ compiler in C? in asm? in 68K asm?
I find it pretty strange that the same guy who is secretary in the standards committe now works for a company that market a definetly non-standard compatible C++ developement suite.
I've worked with Visual Studio in the past, and was always irritated by the microsoft-specific stuff and especially the automatically generated code, which is inserted at compilation time and thus can't be read or seen. I don't like using mystery code in my appilications.
---
"The chances of a demonic possession spreading are remote -- relax."
Fair enough, but given that Herb Sutter is an authority and "evangelist" on C++ in general - how can he reconcile his new position with the new licenses MS are attaching to their development tools which seem to prohibit any GPL'd application (e.g. GCC) linking against their .NET library?
Must you REALLY break the scroller? -_-; Would a mod kindly delete/edit this guy's post? It's annoyingly long.
"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."
:)
I think he forgot to add "because we have waaaay too many bugs to fix" at the end of that sentence.
You've got mail. Pattern baldness. - Crow
It might just be me, but to me, it seems.. well.. wrong, for someone recommending the C++ standard to be part of ANY commercial company who's job it is to write C++ code.
Ok that sound's a bit silly on the surface but think about it: they might recommend specs that make thing's easier for them but harder for other's, or basically have a hidden agenda.
this is ESPECIALLY true for a company like Microsoft who.. well, Lets not kid ourselves Microsoft Apologists: rarely follow standards, and tend to "embrace and extend" the standards they do choose to follow. it just seems like a reciepe for a little underhanded.
But maybe i'm missing something, anyone want to make a constructive critism?
Microsoft IIS is to webserving as KFC is to healthy eating
Hmmmm... Let's develop a runtime and a language that fits perfectly on top of it. Then, let's claim that any language can compile to this same runtime so we have a cross-language platform! Nevermind that they will have to forgo any features that aren't supported by the runtime or at least will have to hack around them. Eventually everyone will move to our perfect single language!
Even VB.NET falls into this category. It doesn't quite match the CLR as perfectly as C# does. I wonder how long until they try something similar C++... oh wait...
All you need to do is make sure that the .NET VM itself works in IA64, and all code automatically works in it too.
My Journal
Herb is the creator and sole mind behind the "Guru of the Week" series, not just one of a panel.
He's also a moderator of comp.lang.c++.moderated, and recently has also joined the comp.std.c++ moderation panel, on which I also sit.
His "Exceptional C++" and "More Exceptional C++" books are more than just printed copies of the GotW material, which is freely available online.
Exceptional C++ in particular is a fine book, and all truly serious C++ programmers should read it.
no way. that's the infamous "gay handlebar mustache." if he were wearing one of those black leather hats, it would all make sense.
Just out of interest... can gcc compile MFC?
Look here for its press release.
FP!
So how long until I they start moving onto the other untainted languages? perl.NET? assembler.NET? english.NET? This is really going too far, really.
___FutureShoks___
C++ luminaire
Penny Arcade reveals eternal thruths.
.NET tool," said Eric Rudder, senior vice president of the Developer and Platform Evangelism Division at Microsoft.
Way to go, Herb. If I could sell out for the kinda cash you must be raking in (suggestions - build giant bin, go swimming) I'd do it in a second. 99% of the personal criticsm is (already apparent) personal jealousy. This isn't a sinister plot to somehow subvert ANSI C++ to MS' evil ends. It's a good career move on his part.
from MS web site:
"Herb's involvement in the C++ community will allow Microsoft to better work with developers building great applications in C++ and ultimately help drive the direction of our Visual C++
i.e. he's a PR figurehead. MS seems to think people will care. Jokes on them. This is too bad, b/c some people are going to be forced to work on C++@.NET, and Herb writes good; if they put him in documentation I'd actually be pleased.
The good and new comes from no quarter where it is looked for, and is always something different from what is expected.
<My C++ flame deleted.> What's the point? Use what you like but leave me to make my own choice. (I do have a C++ project so I know enough to know I don't like it!)
Sig pending!
Beleive me, I know tons of experienced C++ coders who don't know that a method who simply makes if-then-else and cout something on then and else branches can end in more than 20 different execution paths! (the topic is quite big, check the book... trust me, it's worth!)
If your C++ syntax is anything like your English syntax, I'd be surprised if you could get hello_world.c to compile.
For MS he now is a C# expert and evangelist. Why get the good guys from C++ unless they wanted them to switch to C#?
------I can please only one person per day. Today is not your day. Tomorrow isn't looking good either.------
Maybe now with him joining the MS team he can maybe push for more compatabilty between the compiler sets. I know theres alot of G++ and VC++ extensions that people would like to see in both sets. Maybe one day this may make porting apps specialised for one compiler to another easier. Just my 2 cents :)
"What do you mean you have no ice? Do you expect me to drink this coffee hot?" - Random Customer, Clerks
Must you REALLY break the scroller? -_-; Would a mod kindly delete/edit this guy's post? It's annoyingly long.
Are you saying a troll's post is annoying? Best tell him, and sure thats not what he meant to do...
From the article:
/do/ want portabilty, you're on your own: you'll have to invent your own abstraction layer in order to achieve it. Obviously, some succeed better than others in that respect, and as he says, it doesn't keep people from trying.
:P), is much better for offering cross-platform services and libraries, simply because the burden does not lie upon each and every individual library developer anymore to create a platform abstraction layer. That only has to be done once, by the runtime.
.NET. But I think the reason why these are so big and ugly is because they want to make it possible to put the interface at every conceivable place. Of course the interfaces will be complex if you do that.
"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."
Well, that proves the point, doesn't it -- HTML + JavaScript is apparently a "language" that people find better suited to define standard, cross-platform GUIs in than C++!
The reason may very well be that C++ GUIs tend to they tie in to too many features of the underlying platform to be portable. If you
It seems that any language that uses a runtime (for HTML+JavaScript, that's the browser; for Java, that's the JVM; for Scheme, that's Emacs
Really, this is not exactly a mind-shattering concept (USCD-Pascal on p-Code anyone?)
Not that the current state of affairs with HTML+Javascript or Java gives much reason to feel content, but I *definitely* still see the point of having a runtime that offers a standard, special-purpose language to define GUIs.
However, I think the API for such a runtime should be viewed more as a data protocol than as a set of language-specific functions to call.
And *that* really applies to more than just GUIs: there really is a need for portable APIs that are not tied to any language these days, if you look at those complex, horrible 800lb monstrosities like Corba, COM or
Why not focus on *data-centric* APIs instead, that are intended to be put where the interface is as thin as possible, and build them as efficient and robust as an internet protocol should be?
If you're thinking of XML now, that may be close, but I really can't see how XML is the most efficient and easy-to-implement way of transmitting trees of attribute/value pairs. It's too difficult and slow to parse, to start using it as a transport for local subsystem calls as well, and contains too much redundancy, such as named close tags.
What the Internet and your local system needs is a good OSI layer 5. Is HTTP + XML really the best thing we can come up with?
All generalizations are false, including this one. (Mark Twain)
There is an option is MSVC which is called Disable language extensions but which in fact makes the compiler more C99-compliant.
I think, the first step this guy sould make is to rename this option into Enable Microsoft C++ extensions and make it disabled by default.
But does this article have anything to do with C++ ?
No matter what people think of him going to MS, the man knows his C++. Merit is what counts people, not where you sit at work, or the name attached to your business card. The only thing worth keeping is ones integrity and work ethic. Companies, languages and platforms come and go, so don't get too attached to the latest fad.
I understand all too well that my employer forces me to use java. Being a c++ guy this makes my stomach turn. I consider java to be one of the darkest forces in nature. Invented to crush attempts at being intelligent.
Anyone got a real job for me?
no sig error.
His webpage is Frontpage generated.
Not to start a flamewar here, Herb, but this idea seems to help in a similar way a decent variable naming convention helps. Additional information, embedded in the code, (with the resulting maintenance hassles) has the potential to save a lot of time during maintenance and when you have a new hire.
The reply might be that such meta-information belongs in a design document. Fair enough, yet you've merely re-located a requirement, not obviated it.
I guess with an infinite budget we could just hire an army of gurus who sneeze, emitting code that compiles on any platform with nary a warning...
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
Nothing was mentioned about the impact that the changes in the C language in C99 would make on C++. Given that currently they're incompatable
and that a lot of C++ coders are actually C coders who happen to use a C++ compiler to compile their C code it might have been a useful
point to bring up.
That's the data it's my job to distill -- to separate patterns from noise, well-thought-out requests from blue-ski wish lists
:)
Blue skis? Man, I could really go a pair of those. Of course, looks like I won't be getting any from Microsoft...
deus does not exist but if he does
Make that hello_world.cpp
It's kinda sad to see how hard everyone is being on MSVC++ for it's non-conformance and extra features, when by default the beloved and free g++ does the same thing. g++ doesn't become a strictly ANSI compilant compiler until you start throwing switches (-pedantic for one). There are plenty of non-standard pitfalls to get caught in otherwise...
no compiler on any platform will compile all of the boost and loki libraries, not even gcc on linux.
But many compiler vendors are seeking to increase their compliance. Hey, it's not a toy language :-)
Developers Developers Developers
What's the best way to implement the "finally" clause for exceptions? Having to "free the new thing" twice is completely anathema to good coding practice. try { // make something new
} catch (Exception e) { // free the new thing // exit routine
} // free the new thing
Yes, professional whiner.
oh wait that would entail taking risk on your part. No one forced you to take a job programming in java. Simply quit.
I think now you will begin to see a better VC++, on the limit they will open it and converge to ANSI and ISO standards.
------I can please only one person per day. Today is not your day. Tomorrow isn't looking good either.------
Cut the anti-MS FUD flak about MS doing something evil in extending an adopted programming language specifications.
So, in your world, MS must get the entire standards comittee to agree that a MS proposed language extension is good before implementing it.
I'm glad you want to slow down the evolution of programming langauages.
I don't seem to remember Sun getting Java fully adopted and approved by a standards board before releasing the first version.
Get over it, people will extend and adapt current specifications as they want to.
...What the deal is with C++. It's a terrible language with NO pre-thought design (Stroustroup has said in interviews that he doesn't think it's necessary to design a language before writing it) that is so badly broken that nobody has EVER made a fully compliant compiler (or, indeed, is even CAPABLE of making a fully complaint compiler). Herb Sutter says that you should go out and learn lots of languages if you want to be a better (C++) programmer, but the only thing that other languages taught me was how BAD C++ really is. I'm desperately hoping for C# to take over. Everything I've seen makes it a fair step up on C++. Java is a fine language, if you use it properly, and Squeak (http://www.squeak.org) Smalltalk is fun, simple programming. Objective-C is great for people that want to program in an object oriented, C based language, and there are legions of other languages that get barely used, even though they're super good.
I program in C++, but I don't think I'll ever like it. The language is too big, too complicated, and gives bad programmers too many ways to blow their feet clean off. I believe in the original C language philosophy. Small, simple, fast, powerful.
From his document about things to be added to the C++ standard - talking about Random Number Generators:
:)-
RNGs are used all the time for all sorts of things, from unimportant things like generating die rolls in a board game, to important modeling applications like generating random input for stock market simulations, to vital and crucial and easy-to-get-wrong security applications like creating unguessable input for cryptographically secure secret key generation.
So...the die rolls are unimportant eh? Yeah...this guy has lost it.
Microsoft definitely needs to boldly go where C++0x goes, which will be in part derived from C99. C99 is cool. Can you say "complex"? Yeah =)
I just hope VC++'s next compiler is the last one that is not compliant... it's too freaking painful sometimes.
Bzzzzt. Bullshit. Comeau compiles all of Boost and all of Loki. Comeau is fully ISO compliant except for "export", and "export" is on its way quite soon.
It's great to see that Microsoft considers people like Herb to improve the quality of their C++ implementation.
:-)
It's sad that after more than 10 years, C++ compilers all over the place still have a lot of trouble compiling C++ code. It's already bad enough that C++ is too difficult for most programmers. It's definitely a severe problem for C++ that most compilers can't deal with advanced C++, and fail compiling things like Loki. And yes, I'm talking about G++ too
What draws people to Java is not only the simplicity of the language for programmers. It's also the fact that most compilers have no trouble compiling your code on all platform. I think that's a point that most C++ folks (including Herb in the article) fail to understand. But to get this, you give up many handy features, notably templates.
I personally believe that there is another way, and that new programming languages are still a good idea.
-- Did you try Tao3D? http://tao3d.sourceforge.net
because some job interview questions I sat recently were taken directly from the book/site :-)
Argh, the difference between implicit and explicit copy construction and direct construction :-/
Since the compiler status page on www.boost.org dated 7 Feb 2002, testing Comeau C++ 4.2.45 beta 2 with libcomo beta 14 claims that it fails several tests. Not having the compiler myself I do not know whether or not this is significant. I know my day-to-day compiler fares much much worse.
However, Greg Comeau thinks that the forthcoming version 4.3.0 plus dinkumware libs will be compliant, which is a very good thing. Well, it is the oldest extant c++ compiler after all (15 years old?). I've only been writing C++ commercially for 12 years, so it predates my knowledge.
At first glance I thought the title read Irish Stew With Herb Butter...
/. at lunch time ;)
Oh well, I guess I have to stop reading
C'mon, there is absolutely no need for a language like that! You should use the right tool for the job, and lemme tell you, C++ is not necessarily the right tool. To whit, applications that should not be written in C++:
- high-performance embedded applications
- text processing applications
- Hello, World!
Seriously, though, an programmer who has only one tool in their toolbox is a waste of space. I swear, the world must look like it's made of nothing but nails to this guy, 'cuz all he has in his toolbox is a big freakin' hammer...S.
HTML + JavaScript is a better cross-platform interface than just about any other currently in existence. That's why it's so popular as a combination.
OTOH, I'd love to see you write a full-blown word processor or a 3D FPS game in HTML and JavaScript.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Interesting, then, that its history is so well-documented, and Stroustrup himself has written a whole book on how the language was designed, the rationale behind each feature that was, or was not, provided, and other historical reasoning behind decisions that were made. Where's the Java or C# equivalent?
Well, except for the currently-under-test Comeau compiler, which provides just about everything there is, and the internal code at MS, which is rumoured to support pretty much everything except export, anyway.
Y'know what? I really hope you're wrong. But unlike you, I'm going to justify my position.
Firstly, I work at a software development house, and on a MLOC C++ project. Our clients just hired a new whizzkid just like you. They provided all the latest tools, and he's come up with this really cool interface using C# and .NET. The only slight problem is that, unlike many other languages, he can't figure out how to use the 500,000 lines of rigorously tested mathematics we've accumulated over the past decade, so his code is utterly useless. Had he written in any number of other languages that were designed to communicate freely rather than locking you into a pet framework with much hype but little real support, he wouldn't just have cost them thousands of pounds for a cute but useless prototype. So, that's one thing where C# has a long way to go to catch C++.
There are many more. The obvious and boring example is templates and the standard library. Then there are all the portability issues, but I suppose they don't count because .NET and the CLR are portable and support many platforms, languages, days of the week, etc. There's the teensy-weensy little issue of performance, which is pretty much untested in C# and .NET as yet. Don't you think the Java developers might have learned a trick or two in the past few years? There's the insistence on everything being an object, single inheritance and a common root, all of which are as flawed as they have ever been. And in return we have what? A garbage collector? They could at least have learned from Java's mistakes and provided a decent mechanism for managing other resources -- which C++ has had for years -- but they seem to have forgotten that people also need to close files, release locks, share databases and such. I could go on, but what's the point? You're obviously massively prejudiced and unwilling to make the effort to get anything worthwhile out of C++, so why bother?
Oh, and bad programmers can blow their feet off in every language I've ever written. Still, at least in C++, good programmers can be great.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
This is complete nonsense. C++ is NOT a bad language. If you've ever heard Bjarne talk, you would know that he has a powerful mind for design, and his research background gives him the practical experience to build a great language.
C++ is big. C++ is complicated. But these features do not make it a poor language. Rather, it takes a better programmer to effectively use C++.
And you believe in the "C language philosophy"? The C language philosophy was "hey guys, I'm tired of porting assembler from machine to machine, let's generalize it". C is not faster than C++. At all. If you are a horrible C++ programmer, and completely missuse the more advanced features of C++, well, then C might be faster.
And powerful? C is not powerful. Powerful is the STL - being able to use hyper-efficient genralized data structures with very little effort, and having that code be portable to virtually every platform you could dream of. Powerful is built-in exception handling.
I love C but hate C++ b'se no one follows the standards. It is so bad one wonders why they even waste time trying. ...whoever could listen, they later saw the light and moved to Java). Naturally they were extremely strict with the coding standards.
I studied C++ in college (under heavy protest to the instructors, deans
I got a job updating C++ code that turned out to be a mesh of C/C++ and any other dialect in between.
Forget about the compiler differences. These were the kind of coders who use Cout/Cin in C!.
To make matters worse I saw similar code snippets in the "Dr.Dobbs" magazine.
Now, I know many of you do this & recognize the benefits. But why bother with standards in the first place?
What I want is a language I can use anywhere to truly create Rapid Applications.
A productive language that enables me to spend more time designing than coding.
One that gives me a lot of control. (i.e. One that does it my way and not the M$, Sun or Borland way.)
In short, I want to talk to the machine and have it do what I want instantly.
A language so natural that 10yr old can understand it.
I realize newer languages like Java/ C# are striving to achieve this but that's a further waste of time.
We waste a lot of resources learning them and their ever-changing standards that no one follows.
Those resources could be well spent developing designs, patterns, e.t.c.
We should develop software with the languages we use daily.
As a person who speaks 5 different languages with at least 2 dialects of each, the last thing I need is another language just to communicate with a dumb machine. (B'se the machine is dumb & doesn't understand me is lame.)
That's what M$ & Herb Sutter should be focusing on.
Give us the means to talk to our IDEs in plain language and have them translate (crunch out the code) everything for the dumb machine.
The developer should not be bothered with that!
How can that be obtained?
Well, use your imagination...:-)
All I can say is that in a few months I will be developing software from a sunny beach with just a cell phone and a stick to draw designs in the sand.
Happy coding.
You seem to assume that being a C++ evangelist means that one must be an open source evangelist as well.
His new position seems to be that MS should strive to make their compiler ISO-compliant. Great. Nowhere in the ISO C++ standard -- nowhere in all 768 pages -- does it say that the compiler must also be OSS-friendly.
Would it surprise you to learn that Microsoft employees occasionally contribute code to GCC, in order to help binary compatibility? Granted it's never going to be fully binary compatible, since the Visual C++ vtbl layout is patented, but POD structs can be.
You cannot apply a technological solution to a sociological problem. (Edwards' Law)
This is factually inaccurate in the extreme. Everyone follows the standards. Meaning that they're still playing catch-up. The standard was new in 1998, so if you have much experience, then there wasn't an official C++ standard when you took your first course.
We waste a lot of resources learning them and their ever-changing standards that no one follows. Those resources could be well spent developing designs, patterns, e.t.c.
This is a false either-or dichotomy. Time is spent developing this stuff, but this doesn't mean we shouldn't develop new espresso machines.
Give us the means to talk to our IDEs in plain language and have them translate (crunch out the code) everything for the dumb machine. The developer should not be bothered with that!
The problem is that you need to be able to express your ideas in a coherent, logical format. The machine can't do your thinking for you. Having finished grad school in math, where you don't need to write code, only state your ideas clearly, it's simply not as easy as a superficial glance might make one think. Most people can't do that. If they could, they'd be orders of magnitude more productive, and software wouldn't have any bugs (yeah, right)
C++ standard is stabilized, its proper implementation is nowhere in sight (especially by Microsoft, no matter what they proclaim as their goal -- was February supposed to be the month the whole company had to spend entirely on fixing security bugs?), so it doesn't matter what those people are doing.
Of course absolutely idiotic idea that someone's cumbersome library is a part of the language, gives a lot of fuel to the "progress", but I hope, programmers will learn soon that TEMPLATES EXIST FOR THEM TO USE, NOT TO MAKE STL WORK. That will, of course, happen when enough smart people will start using C++ -- right now C++ is mostly being used by people too dumb to use C, or ones that had misfortune to get some crippling course that teaches C++ without C, thus making otherwise good language a domain of ignorant people.
Contrary to the popular belief, there indeed is no God.
Sorry, that's not a very convincing argument. Open source developers are (a) a tiny subset of the whole group of developers, (b) motivated as much by fun as by the power or technical soundness of their tools ("Ooooh, shiny new features in a nice-sounding language") and (c) frequently not experienced enough to judge a language on its technical merit anyway. Of course, there are exceptions, but surely you'll admit that most OS developers fall into this group. Given that, it's not surprising that C++ is not the language of choice. It's too hard for most hobbyists to make the effort to get the best out of it. When writing good code that stays good pays your rent, you look at things differently.
Sure. But it's a big, superficially ugly, powerful trade-off. The underlying models in C++, and the things you can do with them if you need to, are literally years ahead of the Javas and C#s of this world. From that point of view, C++ is a beautiful thing indeed; it all depends on your perspective.
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
Java trades compile time optimisations, performance and static type safety for simplicity.
Also for just-in-time dynamic optimizations, memory management safety, "run-anywhere" (well, declared at least) and standardized distribution/deployment form.
Matz (the Ruby guy) said in response to "why another language", that if someone found Ruby useful, that was a good enough reason for him. I think this is a good philosophy.
I, personally, believe that the future belongs to dynamic P-code languages such as Ruby and Python. They have clean "native" interfaces, so if you want full speed, you get to the C API and hack away. Or, if you're willing to trade some more performance for the benefits of Java, use Jython.
My exception safety is -fno-exceptions.
Given the relative ease with which one can put Ruby and Python bindings on C++, C++ makes a better choice for a "low level" language to work in tandem with python or ruby.
.so's built of C++.
Until there is the C++ ABI standard agreed upon and most compilers (actually, g++ alone would be enough) implement it, I won't touch any extension
For example, it's much easier to write a matrix library in C++ than it is to do the same in C
Ironically, we've already got NumPy.
Granted, C++ is not going away anytime soon, I myself program in it for a living, but it's not a magic bullet either.
My exception safety is -fno-exceptions.