Slashdot Mirror


Interview Update With Bjarne Stroustrup On C++0x

An anonymous reader writes "DevX interviewed Bjarne Stroustrup about C++0x, the new C++ standard that is due in 2009. Bjarne Stroustrup has classified the new features into three categories: Concurrency, Libraries and Language. The changes introduced in Concurrency makes C++ more standardized and easy to use on multi-core processors. It is good to see that some of the commonly used libraries are becoming standard (eg: unordered_maps and regex)."

16 of 589 comments (clear)

  1. Re:On of the features: by meringuoid · · Score: 5, Funny
    I'd like chaotic good please

    I hate to be the one to break the news, but C++ isn't the only thing that's been revised recently...

    --
    Real Daleks don't climb stairs - they level the building.
  2. LOL C++0x0Rz by jeffb+(2.718) · · Score: 5, Funny

    ...or, as a former manager explained it, "When C++ is your hammer, everything looks like a thumb."

    1. Re:LOL C++0x0Rz by Xeth · · Score: 5, Funny

      No, no. It's "C gives you enough rope to hang yourself. C++ gives you enough rope to hang yourself and every programmer who comes after you"

      --
      If your theory is different from practice, then your theory is wrong.
  3. I just don't get it.... by AmazingRuss · · Score: 5, Insightful

    ...what do people find so difficult about C++? Use the standard libraries, exception handling, and make sure your news all have deletes, and it's no more difficult than any scripting language. I actually prefer it over scripting languages, which have their place, but feel all sloppy and unspecific. It's like the difference between building a house out of 2x4s and building one out of sticks you found laying on the ground.

    1. Re:I just don't get it.... by Free+the+Cowards · · Score: 5, Interesting

      Well, here's what I personally dislike about C++. You don't have to agree with them, but this is how I feel and I think it's how many other people do as well. Certainly when talking to people who prefer other languages over C++, they have expressed similar sentiments.

      1. Lack of libraries. The C++ standard library basically gives you file IO, containers, and that's it. If I want to do something like fetch the contents of an HTTP URL, parse XML, serialize objects, compute dates and times, use regular expressions, compress data, or even just simple, basic Unicode support, then I have to hit some external library that I may have to install and probably can't rely on existing on another machine.
      2. Flexibility. In C++ it is essentially impossible to make, say, a dictionary where each key can refer to an object of a completely different type. This is what you refer to as "sloppy", but I actually find this flexibility to be essential in designing good software. The fact that C++ does not allow it forces me to either twist my program's design in unnatural ways to fit the language, or do a lot of extra work to twist C++ to fit my program's design.
      3. Manual memory management. In any complex program, balancing your news with deletes is not as simple as you make it out to be. Object ownership is a tough problem. Lots of C++ code solves this problem by making a lot of defensive copies, which in turn hurts performance greatly.
      4. Errors. Make one simple typo in a template instantiation and you can generate literally pages of twisted, non-obvious errors. This makes it much harder to get a C++ program to compile than it should be.
      5. Nonportability. C++ compilers tend to differ massively in just how well they adhere to the C++ specification. Creating portable C++ code is much harder than it ought to be, especially when you take into account the necessary dependence on external libraries I mentioned above. And then you need a build system to go with all of that, which brings its own set of headaches.
      6. Readability and writability. With all the type information being declared all over the place, big template declarations, and the like, I find that C++ takes considerably more effort to both read and write.

      The really big issues for me are the flexibility and the lack of libraries. The rest is less important. But with C++ it's like building a house out of 2x4s that you're not allowed to cut to length, whereas with moer modern languages it's more like building a house out of prefabricated rooms, with a ready supply of 2x4s and tools to shape them as you need if the prefabbed rooms don't fit your needs.

      Please note that this is just my opinion, and you asked for it. Feel free to disagree, but please don't flame.

      --
      If you mod me Overrated, you are admitting that you have no penis.
  4. Re:It hurts you to learn C++ is still being used. by johannesg · · Score: 5, Insightful

    ...and roll on the C++-hatred! Second C++ article in a short time, and again lots of venom and anger. "Months saved in development"? Really? What are you doing, implementing your own OS before you start application development? Here's a newsflash: C++ also has support libraries, just like Java, Perl, Python and Ruby. They may not be part of the language specification (and I still think that's a weird idea to begin with, but I'm old-fashioned that way), but that doesn't mean they don't exist.

    Anything you could want for in a modern language is there. And nobody is holding a gun to your head and making you write those scary templates if you don't want to.

    I'm just positively amazed that Slashdot, in theory home of programmer geeks anywhere, should have such a violent dislike of C++. Not that there is nothing to criticize about it, but it is still an amazingly powerful, versatile tool that programmers anywhere would do well to learn.

  5. Truer words have never been spoken. by Anonymous Coward · · Score: 5, Funny


    C++ is to C as Lung Cancer is to Lung

  6. C++ has one major problem by Barnett · · Score: 5, Insightful

    C++ is an extremely powerful programming language and that is why I use it every day. But it has one major problem: It is too complicated. As long as you do programming full time you are OK but if too much of your time is spent on the application side of things you quickly get in trouble. This is what people like BS don't seem to get - not everyone can spend 100% of their time studying the language.

  7. Re:It hurts you to learn C++ is still being used. by Free+the+Cowards · · Score: 5, Insightful

    No, the "premature optimization" thing applies to all areas. Especially areas where it's never fast enough.

    Why? It's simple: resource management.

    You have X amount of resources to put into your product. X is always finite. It's kind of tough to measure X, but you can think of it as lines of code, man-years, or even just dollars. The amount of resources you have varies a lot depending on your budget, how much time you have, and the quality of the programmers you have. But the important thing is that X is always limited.

    Now you have two approaches:

    1. Spend X on making the code fast from the start, and keep spending X until you run out.
    2. Spend X on making the code functional and with good design. When appropriate (i.e. when the design is good and the code works), start spending X on making the program go faster. Keep spending X on speed until you run out.

    Paradoxically, I hold that #2 will produce a faster program. This is because the X you spend on making the program faster in #2 will be more effective, because you've already laid the groundwork for it. It's always difficult and time consuming to optimize code that doesn't even run yet. It's much more efficient to optimize code that already works. So the result, even though you spend less X on speed, is a faster program.

    Think of it as transporting a lot of material into the wilderness somewhere. If you first spend some of your resources on building a road, you'll get the job done for less time and money than if you just start hauling stuff into the woods immediately.

    --
    If you mod me Overrated, you are admitting that you have no penis.
  8. auto rocks by ultrabot · · Score: 5, Interesting

    The new "auto" declarations really fix one of the biggest gripes with C++. Everybody is dead tired of doing


    std::map::iterator it = m.begin()

    Now you can just do:

    auto ip = m.begin()

    It takes much of the pain away from static typing...

    --
    Save your wrists today - switch to Dvorak
  9. Re:C#++? by drxenos · · Score: 5, Informative

    No it's not. The standard does not define concurrency issues. Not how to spawn threads and create mutexes, but lower-level issues, like coherency. This is sorely needed for truly portable code. Rvalue references will help a lot with the creation of temporaries that are just copied and destroyed. You see this now in all the specializations in the libraries for the swap function. With rvalue references, you can write a single template that will be optimal for all types. Currently template error messages are a mess. several lines of unreadable garbage because your type doesn't supply a member or operator that the template needs. Concepts will lead to concise, easy to understand error messages. typedecl and the new use for the auto keyword will reduce verbosity, and stop the nightmare that is figuring out the type of a complex template (i.e., when using Spirit, et. al.). Lambdas and closures will simplify using the STL algorithms without having to create a lot of functors. REH

    --


    Anonymous Cowards suck.
  10. Re:Some counterpoints. by Free+the+Cowards · · Score: 5, Interesting

    Counter-counterpoints:

    1. Boost is an external library, and from my very limited experience none too easy to incorporate.
    2. Likewise, an external library. But putting that aside for a moment, what's the C++ equivalent to this python code?
      d = {"name":"Bob", "age":42}
      print "Name is %s and age is %d" % (d["name"], d["age"])
      Keep in mind that this is a complete python program, no further code is required.
    3. While those are handy, they don't substitute for a real garbage collector.
    4. I hope you're right, but I'm skeptical. Massive template instantiation errors seem to be a compiler problem, not a spec problem.
    5. Key words being "can be". It's tough to do, especially since the compilers out there almost never comply perfectly with the spec.
    6. Of course it's a matter of taste, I never said otherwise.
    --
    If you mod me Overrated, you are admitting that you have no penis.
  11. Re:It hurts you to learn C++ is still being used. by Yokaze · · Score: 5, Interesting

    > I'm just positively amazed that Slashdot, in theory home of programmer geeks anywhere, should have such a violent dislike of C++.

    Because C++ is not a pure language. It is a multi-paradigm language (imperative, OO and functional) with both a high and low-level language features and people seem to hate the aspect they which they don't prefer.

    The close-to-the-metal types hate the high-level aspects and rather use C. Disregarding the fact, that changing the code from C to C++ is purely syntactical and runs without any detriment in performance. Exactly the prime idea behind C++.

    The high-level people dislike C++ exactly for this approach. They don't like that the basics are so clearly visible, and are even the default. You have to hop through some loops, before you get to a higher abstraction layer. E.g. you have to use external libraries and/or special classes for memory management.

    Personally, I like C++ for exactly that reason. I can start on a fairly abstract layer with pure virtual interfaces, smart pointer, signal slots and there is not a single (raw) pointer or a manual deallocation to see (or other manual resource deallocation).
    Granted, it is more verbose than in a pure high level language, but that is what the machine has to do.

    And if there is a performance bottleneck, I can seamless go down in the abstraction level from simple inline functions, over imperative functions with pointer arithmetic, down to inline assembler and can even guarantee a certain timing, if necessary.

    --
    "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
  12. Re:Some counterpoints. by Kevin+Stevens · · Score: 5, Insightful

    Boost has in many eyes really transcended from "just an external library" to an integral part of the C++ platform. It compiles on every major platform, and it is open source.

    Boost is moving C++ forward at a rate 10x that of the standards committee. I am not sure why you felt integrating it with your project was difficult- it is header only for the most part and does not require you to use any specific pieces. Shared_ptr's, which are the most useful library of all, do tend to be viral in the sense that you have to use them everywhere, but this is a GOOD thing.

    If you are doing C++ without Boost these days, you are really missing the boat.

  13. Re:Some counterpoints. by Anonymous Coward · · Score: 5, Insightful

    It is the discussion. Judging c++ with boost excluded is like judging perl with CPAN excluded. Who cares whether it's "part of the language" or not? Everyone who uses the language seriously uses them, and they're critical to understanding how the language is used effectively.

  14. Re:C#++? by Yetihehe · · Score: 5, Insightful

    If you make language even an idiot can use, idiots will be using it. Like with VB.

    --
    Extreme Programming - Redundant Array of Inexpensive Developers