The Future of C++ As Seen By Its Creator 424
holden writes "In a rare public talk, C++ creator Dr. Bjarne Stroustrup discusses his ideal in programming languages, as well how he sees the next version (and beyond) of C++ developing. He explains the general selection criteria used for adding new features, some of the legacy of C++, and many other interesting topics. Especially interesting is during the Q&A he explains his views of the embrace and extend mentality some implementations, such as VC++, have taken."
uh... (Score:4, Insightful)
Mod Parent Insightful (Score:5, Insightful)
The problem with VC++ (Score:5, Insightful)
If you look at the new Visual Studio 2008 - in the three years since 2005 was released, what does Orcas have for C/C++? Still no C99, with open admission that there are no plans to support it. No TR1 for C++. No significant compiler changes. Intellisense is still slow and quite easily stops working all together. Still no assembly support in the 64-bit compiler, missing intrinsic functions for important instructions such as CMPXCHG16B.
What we get is a newer bundled Windows SDK (which you can download NOW), updated MFC libraries (yuck), and a few new options for Vista compatibility.
In three years,
Re:Next version? (Score:2, Insightful)
Why is this candidate "bad" because he interprets a piece of marketing twaddle (i.e. the name of C#) in a different way from Bill?
Round here we (mostly) purposefully call things the wrong name, usually as an exclusive in-joke because we all really know what the real term is meant to be. This includes Giga- pronounced "jigga-" and internet called "interweb" or "interwebnets". My favourite is referring to C# as "coctothorpe" as the proper name for the # symbol is octothorpe. I also used to call C++ "C double plus" as "plus plus" just sounds so ugly (and I'd just finished reading 1984 when I started programming).
This candidate may be useless for other reasons (and it looks like he is), but calling a silly programming language with a silly name something silly shouldn't be held against him.
Re:uh... (Score:5, Insightful)
That ruined the joke for me. Like Stroustrup would ever include the legacy non-namespaced header!
With all respect... (Score:2, Insightful)
Yeah, go ahead, bring out your flame hose. Even if I had to burn in hell, this thing is still a monstrosity.
Re:The problem with VC++ (Score:5, Insightful)
If you look at the new Visual Studio 2008 - in the three years since 2005 was released, what does Orcas have for C/C++?
I'll see you VC++ 2008 and raise you VC++ .Net (aka VC++ 7.0, aka the 2002 release).
The sad thing is, from a pure C++ programmer's point of view, a lot of people still regard VC++ 6 as the peak. Sure, the standards compliance is better now, and that's a real improvement. Sure, there have been a few optimisation improvements, and those are worthwhile (when they don't introduce bugs). Sure, the debugger has better visualisation support (autoexp.dat) even for native code, and that's definitely useful (if only they'd document it properly).
But when they moved to .Net for everything, the IDE slowed down horribly, even without the Intellisense/multi-threading mess that they finally fixed in 2005SP1. Certain features (I'm looking at you, browse toolbar) actually disappeared from VC++, for the rather poor reason that they couldn't be supported in all .Net languages. I understand that the whole unified architecture thing makes sense from a development perspective at Microsoft, but the bottom line is that users don't care, and removing useful functionality is bad. I also appreciate that, several versions later, we now have most of the same basic functionality back again, but it's still a mess compared to the simple, effective browse toolbar. Similar comments apply to various being-too-clever changes to Intellisense, incidentally.
Perhaps more seriously, as great as all these new optimisations are, we've found far more compiler bugs recently than we ever used to. We write serious mathematical libraries at work, and I promise you it is not fun to spend several days tracking down a bizarre floating point problem, because it turned out that the global optimiser got it wrong fifteen functions up the call stack and now the FPU stack is overflowing.
Meanwhile, we get to see Microsoft putting lots of goodies in for .Net developers. I'm sure they'd love us all to develop for .Net, but until they support it on seven different platforms (where all versions of "Windows" are grouped together as just one of those), it's never going to be of much interest to us.
Right now, Visual C++ is still (in my personal opinion) the best C++ compiler/IDE combination available today. But things move fast in software. Code compiled with g++ has lagged in performance for a long time, but if the recent work behind the scenes on things like SSA bears fruit, that performance gap could close very fast. Eclipse/CDT is so clunky as to be almost unusable for C++ development right now (don't flame me, it's just a personal opinion) but I check every now and then to see how things are going and it sounds like someone might be planning a big clean-up so it doesn't feel like C++ forced into a Java-friendly IDE any more. With Microsoft pushing all their funky new UI support into things like WPF that almost no-one uses, and portable GUI toolkits like wxWidgets and Qt becoming better all the time, it's not like having MFC support is a great bonus for new developments anyway.
In other words, if VC++ 2008 doesn't deliver real improvements for non-.Net-only C++ developers, it's entirely possible that the serious players will be switching to genuinely better open source alternatives for new developments well before the next version of VC++ is out. And that should scare Microsoft, because the superiority of VC++ and the ease of use of VB are the reason so many people have been making effectively Windows-only software for so long.
Re:Parent is trolling (Score:3, Insightful)
I agree that a good developer will almost never need to use assembly. Unfortunately there are some (very few, but still some) things you just can't do efficiently in C++ - be it a limitation of the language or the compiler.
Believe me, I wish Microsoft could implement intrinsic functions for everything I need (like CMPXCHG16B mentioned previously). But they don't. I want nothing more than to not have to touch assembly!
Re:The problem with VC++ (Score:3, Insightful)
Not that I have anything against C or C++, but for applications (i.e. anything made by Visual C++) I don't think it's an ideal language. We've (as an industry) wasted too much time getting it working with a modern GUI environment already, let's move on. Make fun of VB or C#, or even Obj-C/Cocoa if you want, but all those languages are designed, and excel, for GUI software development.
Re:not bad... (Score:2, Insightful)
C++ is anti-C (should have been named ~C):
can't tell what's going to happen just by looking at code
(you have to look way behind the scenes
Re:C++ needed improvements several years ago. (Score:2, Insightful)
Re:uh... (Score:3, Insightful)
Re:Mod Parent Insightful (Score:2, Insightful)
The Internet is not for "text", it is for data.
Re:uh... (Score:3, Insightful)
They don't remotely mean the same thing. (Putting aside that you then go on to demand that more words mean the same thing.)
Re:C++ needed improvements several years ago. (Score:3, Insightful)
Again, I'm not an expert in this area, but it seems to me that Dr. Stroustrup tends to define his leadership narrowly and concern himself with programming constructs rather than larger issues such as extension, standardization, and certification of libraries, for example. About C++ garbage collection he says, partly: "See ... Hans-J. Boehm's site [att.com]". It seems to me that there are too many areas in which the C++ answer is "You can just go there", rather than "This is the standard, certified method."
You left out his quip about how C# and Java leave twice as many resources open at run time and something about sloppy programing. A run time GC is not something I believe is needed in C++. If you want that, write it in Java and live with the associated bloat. Or pull in someones library that does the same thing. An example: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ [hp.com]
What all programmers can't seem to get through their heads is that it takes years to become "proficient" at any language. Once proficient you then understand why things were done the way they were done. Most critics of C++ wish they had learned it or perhaps spent 1 month with it and thought they were experts at critique.
What mystifies me is the masses often get sucked into propriety closed languages/tools like VB, NET, C# (C-Pound) and others. Trouble is, by the time they actually get proficient the vendor will change the API. To a lesser extent this applies to Perl, Ruby, PHP etc also. And off you are wasting time on relearn tools. Which is why I decided early on to learn C right down to the bootstrap code early on. And later learned C++. Not an easy road, but I spend now spend far less time learning tools and much more time punching performance code.
Call me nuts if you will, but I like C/C++. And suspect, like Dr. Stroustrup does, they have been predicting the 2 year demise in C++ for 12 years and it is still with us. Sun likes Java because it sells big servers to run that bloat ware. Who is kidding who?
Re:not bad... (Score:3, Insightful)
The problem is that there are so many ways to do things wrong in C++. Writing proper code takes experience. It doesn't help either that monsters like MFC easily mess things up.
I was going to quit coding C++ when I discovered Boost [boost.org] and wxWidgets [wxwidgets.org]. Now I don't want use anything else.
Re:It is?! (Score:3, Insightful)
give it a rest (Score:3, Insightful)
What we need is a language with C++-like performance characteristics and a C-like syntax that will feel familiar to C/C++ programmers but without all the baggage of 30+ years of C history.
(And, no, neither Java nor C# are that language.)
Re:With all respect... (Score:2, Insightful)
Yes. It's called LISP. (Also Scheme, and maybe even OCAML.)
There are optimizing LISP compilers that beat C/C++ at floating point calculations. Plus C, and all the new trendy MS
null keyword rant (Score:3, Insightful)
Re:Strostrup is now part of the problem. (Score:3, Insightful)
No thread management : this is an OS-specific issue. Yes, almost all modern operating systems use threads, but C++ isn't designed to do OS tasks. It's a tool so that you can design your own management of threads in a way that suits your projects and style. Use Boost if you want a widely-supported, cross-platform set of thread management classes.
No memory management : again, OS-specific. What if I don't want garbage collection? I like the fact that C++ has deterministic destruction of objects, and I can use that to my advantage. If you want memory management, use boost::shared_ptr and it's siblings. Yes, auto_ptr is broken for various activities, but if you aren't aware of the freely available and widely supported alternatives that work just fine, then you need to update your C++ skill set. Stating that templates are a bolt-on solution for memory management is way off base and shows that you don't really understand that templates are a generic programming construct. And to state that we have buffer overruns in C++ because of bad language features is, again, attempting to assign the problem to the wrong source. If developers would use smart pointers and other safe development tactics, a lot of the problems would go away. Hell, I work with a guy now that refuses to use 'const' in parameters because it involves typing 6 extra characters. It's attitudes like this that cause runtime issues, not the choice of language.
C++ is still a great language. If programmers would take time to familiarize themselves with quick and easy ways to start tightening up their code, we wouldn't have so much problematic software. Instead, everyone sits around and looks at Java, C# and their ilk and demand that the same do-everything-for-me features be brought over. That's not the spirit of C++, and frankly I don't want to see C++ messed with that way. When I want those features, I use those tools and understand why both exist.
Re:Strostrup is now part of the problem. (Score:3, Insightful)
IMHO, I think: .NET languages. You can't have the ability to do whatever you want to a variable, and the ability to be safe from it simultaneously.
a) If you want garbage collection, you have to leave C++ and go to a truly safe language like Java or one of the
b) If you are trying to code a GUI application with cool RAD development tools (like VisualBasic and Eclipse), then C++ is the wrong language. It was never built to be quick and easy for the programmer. Additionally, the windows based object-oriented metaphor makes proper memory management difficult.
c) If you try to use all of C++ in one program, you deserve to be shot. C++ should be used with strict coding guidelines on what features will be used, and what features won't be used. These features can be picked on a per application basis, and thus the language can be customized for almost anything. Just don't try to do everything simultaneously.
What C++ excels at are projects that require complete control of the machine. If you need the asm directive, its there. If you need funky type unions, you have them. If you need to organize your code, so people can understand it, you have objects and namespaces. If you need to customize the behavior of new(), you can do it. If you need C language compatibility with your header files, it can be done. C++ gives you every option that you may need. Just don't use all of them simultaneously.
Re:Strostrup is now part of the problem. (Score:3, Insightful)
Obviously, you never used modern C++ extensively.
Templates are not a macro system, they are a typesafe meta-language. I agree that their syntax sucks, but they are lightyears away from being a simple macro system. And lots of people use them, just look at the STL string or vector. You think few people will use concepts or variadic templates, think again. Generic programming is the actual edge of C++.
I really suggest you read "Modern C++ Design". There you can see perfectly valid examples of how to use templates. Policy-based is a good and powerful example. With this, I can customize my code at compile-time, for example, having a policy which locks a mutex in proper code sections, and another policy with no locks at all. This way, my code *can* be threadsafe, but does not *have* to be (thread safety is useless in a singlethreaded program). Oh yes, I could do that with the preprocessor too, but try debugging this. Also, say goodbye to namespaces, type safety and debugging support.
Safety and reliability have nothing to do with C++ itself. Many people overuse new and delete, without relying on proper RAII constructs, for example. If you think MFC-style C++ is the zenith, you don't know C++. I have been programming C++ for over 7 years and reached a point where memleaks happen extremely rarely (mostly due to rushed code). Its no black arts, no voodoo, just proper C++ usage.
Re:not bad... (Score:1, Insightful)