Slashdot Mirror


The Future of C++ As Seen By Its Creator

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."

24 of 424 comments (clear)

  1. uh... by cosmocain · · Score: 4, Insightful

    ...transcript, anyone? i hate watching or listening to vids at work.

    1. Re:uh... by Pseudonym · · Score: 5, Insightful

      Good afternoon everybody, I would like to start by including iostream.h into the discussion.

      That ruined the joke for me. Like Stroustrup would ever include the legacy non-namespaced header!

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    2. Re:uh... by afidel · · Score: 2, Insightful

      As someone who's used C++ since it was a collection of precompiler directives I LOL'd, but you really should give credit to the original author.

      --
      There are 4 boxes to use in the defense of liberty: soap, ballot, jury, ammo. Use in that order. Starting now.
    3. Re:uh... by Otter · · Score: 2, Insightful
      Why in the hell do you need both restful and restless to mean the same thing?

      They don't remotely mean the same thing. (Putting aside that you then go on to demand that more words mean the same thing.)

  2. Mod Parent Insightful by dreamchaser · · Score: 5, Insightful

    Video or audio just for the sake of being flashy is a dumb idea and I usually won't watch or listen. If I want audio and video I'll devote my full attention to my TV feed. Otherwise when I'm accessing information on the Internet I want text. I can read it far faster than someone speaks on a video interview for one thing, and for another text lends itself far better to (human)multitasking than video or audio does.

    1. Re:Mod Parent Insightful by MightyYar · · Score: 1, Insightful

      Flashy and dumb? It was a lecture! A transcript does not magically exist - someone has to create it. Unless you are willing to transcribe the lecture into text and make it available, you sound pretty hypocritical complaining that someone has taken the effort to make the existing format accessible by Flash, Xvid, Ogg, MP4, and MPG through both BitTorrent and via HTTP. Christ, even my Palm can play several of those formats!

      The Internet is not for "text", it is for data.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  3. The problem with VC++ by PhrostyMcByte · · Score: 5, Insightful

    Is that they have given 95% of the development time toward managed languages.

    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, .NET has advanced from 2.0 to 3.5 with huge changes like WPF, WCF, LINQ, etc. They have all but forgotten C++.

    1. Re:The problem with VC++ by Anonymous+Brave+Guy · · Score: 4, 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.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    2. Re:The problem with VC++ by Blakey+Rat · · Score: 2, Insightful

      Good. I think languages with some kind of automatic memory management are the future and make development easier for software houses, which in turn gives them more time worrying about issues like, "will my grandma be able to use this software?" and less time worrying about issues like, "why does it crash when this pointer is dereferenced!?"

      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.

  4. Re:Next version? by netpixie · · Score: 2, Insightful

    That's a weird article.

    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.

  5. With all respect... by 2Bits · · Score: 2, Insightful

    to Stroustrup, but don't you think it's a bit ironic that the creator of such a monstrosity is talking about ideal of programming languages? And don't even get me into the the differences between implementations!

    Yeah, go ahead, bring out your flame hose. Even if I had to burn in hell, this thing is still a monstrosity.

    1. Re:With all respect... by k-zed · · Score: 2, Insightful

      "A language which supports functional, generic, procedural, object-oriented programming, with static typing, metaprogramming, and heavily geared towards native building?"

      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 .NET crap has nothing on the syntax and expressive power LISP has. But good things and good directions aren't exactly "in fashion" in today's IT...

      --
      we discovered a new way to think.
  6. Re:Parent is trolling by PhrostyMcByte · · Score: 2, Insightful

    A lot of C++ developers are fans of header-only libraries. What can I say, I am too - it makes use of these libraries so much easier. Having assembly files breaks this when writing a library.

    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!

  7. Re:not bad... by Anonymous Coward · · Score: 2, Insightful
    C++ seems to have been designed by someone who hated C.
    C++ is anti-C (should have been named ~C):
    • is complex where C is simple
    • hides what's going on, to the extent that you
      can't tell what's going to happen just by looking at code
      (you have to look way behind the scenes
    • has implementations which are diverging, not converging
  8. Re:C++ needed improvements several years ago. by teknopurge · · Score: 2, Insightful

    Concerning Java, Dr. Stroustrup says "Java isn't platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. That is, you can write programs for Windows/Intel or Java/JVM, and in each case you are writing code for a platform owned by a single corporation and tweaked for the commercial benefit of that corporation." Boy, he must be very happy about openJDK. I wonder what his next gripe will be about Java?
  9. Re:C++ needed improvements several years ago. by canuck57 · · Score: 2, 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/

    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?

  10. Re:not bad... by odourpreventer · · Score: 2, 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 and wxWidgets. Now I don't want use anything else.

  11. Re:It is?! by cerelib · · Score: 2, Insightful

    You are right in a way. Most people do not need pointer arithmetic, but it becomes very useful when you are working with external blocks of data. For example, I was writing some audio capture code in Java and with it you are passed byte arrays. In Java, you cannot simply treat this as a block of data because it is an object. It makes doing things like 16+ bit audio quite annoying. With pointer semantics I can simply treat the byte array like a short array and be done with it. There are many applications that deal with such external blocks of data that also need high performance, which requires the use of memory pointers. To completely replace C/C++, a language must allow this kind of direct memory manipulation.

  12. give it a rest by m2943 · · Score: 3, Insightful

    C++ is my main development language right now, but I have to say: please give it a rest. C++ is what it is, and I don't think adding even more crap to it is going to make it any better.

    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.)

  13. null keyword rant by wiredlogic · · Score: 2, Insightful

    Could it really have been that difficult to add a "null" keyword to C++? "bool" was cleanly added to C99. We could have had "null" too. I accept the argument that (void*)() isn't typesafe but then the language expects you to throw around a literal integer "0" that is imbued with magical properties. How is this a cleaner solution? This magic 0 violates the type safety principal that got us into this rathole to begin with since it can be assigned to non-integral types (pointers). It can also transform itself into another value since the null address isn't necessarily 0 on all platforms.

    --
    I am becoming gerund, destroyer of verbs.
  14. Re:Strostrup is now part of the problem. by macrom · · Score: 2, Insightful

    I don't think Stroustrup is in denial at all. Read his book The Design and Evolution of C++ for insight into his decision making process. You may not always agree with it, but at least he's thought things through. When developers start launching complaints about missing features from C++, they generally miss the point of why C++ exists in the first place. It's not a be-all-things-to-all-programmers language. It's a tool to help you get many different types of jobs done.

    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.

  15. Re:Strostrup is now part of the problem. by Cassini2 · · Score: 2, Insightful

    IMHO, I think:
    a) If you want garbage collection, you have to leave C++ and go to a truly safe language like Java or one of the .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.
    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.

  16. Re:Strostrup is now part of the problem. by ardor · · Score: 2, Insightful

    Most of the standards effort is going into template features that few will use and fewer still will use well. Trying to use the template expansion engine as a general purpose macro system is a terrible idea for production code. But it has a big fan club on the standards committee. Worse, the C++ commitee does very little to improve language safety and reliability. Which is why we still have buffer overflows in C++ code, fifteen years in.

    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.

    --
    This sig does not contain any SCO code.
  17. Re:not bad... by Anonymous Coward · · Score: 1, Insightful

    Two mediocre programmers chiming in does not a bad language make. I'm sorry but someone who's worked with a language for 20 years and still hasn't learned it, well, you guys should stick with VB or Java or whatever the new COBOL is these days. Languages for non-technical people such as yourselves.