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++."
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
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?
"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
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.
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
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)
I vote for replacing -nologo with its inverse first. Another good switch would be "-please-dont-core-dump-on-syntax-errors".
There are 10 kinds of people: Those that understand ternary; those that don't; and those that don't care.
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.
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
It's the library that comes with this book
t ml
http://cseng.aw.com/book/0,3828,0201704315,00.h
It uses enough of the corners of the language that most compilers have problems compiling it.
The book itself is very very good: all experienced C++ developers ought to read it.
or since he is a C++ guru, he doesnt care about html, it seems pretty reasonable. im glad he is more concerned with providing great C++ info than worrying about his webpage html
...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.
I have to agree with you entirely. I am a C++ programmer by heart. But lately I have been doing quite a bit of Java again. Wow, does it work cross-platform. I am using a Windows Intel Notebook and a Linux PowerBook from Apple. Only with Java can I move sources and binaries from one machine to another without any problems.
./configure and then finally we build. Of course lets not forget to include libtool and the likes. PEOPLE what are doing, making work for themselves?
.NET...
In C++ the Open Source community seems to have stuck its head up its butt in complexity. Take for example building a Open Source application. First we run autoconf, then
I have dropped the entire notion of using make files and other things. I ended up using ANT to build C++ programs. What a cool tool. Here is something that was re-engineered and it ends up as being a better project management of sources, executables, etc. And what is ANT written in? Java!
C++ needs to get back to the drawing board and start things over and make things simpler! Java have and so has
Sad to (Really Sad) to say it, but if C++ does not simplify it will run out of steam.
"You can't make a race horse of a pig"
"No," said Samuel, "but you can make very fast pig"
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.
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.
Get a different job then dork
Here, here! No wonder everyone thinks programmers are whiny little geeks. Can you imagine? An entire community has sprung up around such esoteric issues as C++ standards compliance.
Hey, nerds: cut out the whining. It's making it harder for me to feed my kids. And get laid, so I can make more kids. Please mod parent up.
If you fall off a building, go real limp, because maybe you'll look like a dummy and people will be like hey, free dummy
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)
ANSI/ISO is still only 3 years old. Features to support code like Loki (templates, partial specialisations, MI) were not a part of the original AT&T implementation. So a big part of the problem is that it's been a moving target. But then, this is true of most useful languages in their early stages. C for example was standardised in 1989, 18 years after Bell implemented it.
What draws people to Java is not only the simplicity of the language for programmers.
The simplicity is a tradeoff. Java trades compile time optimisations, performance and static type safety for simplicity. This is not "better", or "worse", it's just "different".
Note that Java, like C++, is still very much a moving target.
It's also the fact that most compilers have no trouble compiling your code on all platform.
Java has its share of version compatibility issues, caused by the fact that it's a moving target. It's also worth noting that a lot ot the "different compilers" license code from Sun. Look how long it's taking for a (working!) free implementation of java on Linux to appear.
I think that's a point that most C++ folks (including Herb in the article) fail to understand.
On the contrary, Herb is insightful to understand that other languages also have their advantages. He's a strong advocate of learning other programming languages.
I personally believe that there is another way [sf.net], and that new programming languages [sf.net] are still a good idea.
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.
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.
These are useful to varying degrees. GC is very useful, though it's not a magic bullet, and it comes at a high price.
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.
That's like sayign that the future belongs to screwdrivers, and everyone is going to stop using hammers. I don't buy it. There's more advantages than just speed to a language like C++. Static type checking is extremely useful for large applications.
Python and Ruby are not competitors of C++, they are collaboraters.
you get to the C API and hack away.
Writing objects in C is one hell of a headache. 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. For example, it's much easier to write a matrix library in C++ than it is to do the same in C (and no-one in their right mind would write low level matrix ops in Ruby or Python, unless developer time was in very short supply, or there was an abundance of spare CPU cycles)
Wrap your dynamic pointers in handle classes, like reference counted, or clone() based smart pointers. If you need to do a lot of cleanup in catch blocks, it's often a sign that your code is not granular enough.
*Shudder*, I still think that I've somewhere a spare matrix I wrote a long time ago as an experiment.
Gawd, talk about an ugly thing.
It had about 5 methods, and 6,00 LOC.
--
Two witches watched two watches.
Which witch watched which watch?