Please create an account to participate in the Slashdot moderation system


Forgot your password?

C++0x Finally Becomes a Standard 398

Samfer writes "On Friday August 12th 2011, the results for the final ISO ballot on C++0x came in, and the ISO C++ Standards Committee were unanimous in favor of approving the new C++0x (for now unofficially known as C++11) object-oriented programming language standard which is intended to replace the existing C++ standard. The new standard is to offer new and improved features such as lambda functions, concurrent programming functionality, direct data field initialization, and an improved standard library to name but a few." Although I haven't heavily used C++ in years, it is nice to see a decade long effort finally come to fruition. Especially nice is the support for type inference which should save quite a few people from RSI and make refactoring code a bit less obnoxious.
This discussion has been archived. No new comments can be posted.

C++0x Finally Becomes a Standard

Comments Filter:
  • Congratulations! (Score:0, Interesting)

    by Anonymous Coward on Tuesday August 16, 2011 @01:43PM (#37109254)

    They said it couldn't be done!

    They doubted us!

    But we did it!

    The ugliest, most fragile, hackiest, most garbled, incoherent, biggest mess of a programming language is now even more so!

  • by Animats ( 122034 ) on Tuesday August 16, 2011 @02:12PM (#37109644) Homepage

    It's nice that they finally got the standard done. But there's so much junk in there. The C++ committee was dominated by people who wanted to do cool things with templates.

    Some years ago, someone figured out that it was possible to abuse the C++ template system into doing arbitrary computations at compile time. This developed a fan club. That fan club has dominated the C++ standards committee, because nobody else cared. So now we have a standard for C++ which supports template-based programming a little better.

    Current thinking seems to be that,while template programming is too hard for ordinary programmers, the templates will be written by l33t programmers and then be used by the lower classes. Unfortunately, if anything goes wrong, the end user has to look at the innards of the template to find the problem. We went through this with LISP decades ago. Check out the MIT Loop Macro [], That finally became stable about the time LISP died out.

    Note what isn't in the new C++. There's no more memory safety than in the old one. (Fans will say that it's safer if you only use the new features. Now try to call some library that doesn't use them.) So the buffer overflow attacks and crashes will continue.

    C++ is the only language to offer hiding without memory safety. Hard-compiled languages from Pascal through Go have hiding with safety, as do all the major scripting languages. C has neither hiding nor safety; the pointer manipulations are right there in the source. There have been safe, hard-compiled languages without garbage collection, most notably Ada and the Modula family. Safety and speed are not incompatible.

  • by wsxyz ( 543068 ) on Tuesday August 16, 2011 @02:22PM (#37109756)
    But the winner is:

    (+ A (* B C) (* A D))

    Filter error: Don't use so many caps. It's like YELLING.
  • by wagnerrp ( 1305589 ) on Tuesday August 16, 2011 @02:49PM (#37110098)
    The whole point of classes is that you have create a relatively static interface, and the internals can change around as much as you want. If you change the internals, then all you have to do is recompile that single cpp file and re-link. If you change the interface, then you very likely will need to change many other files to use the new behavior. If you are changing private methods and private variables frequently, perhaps you should instead store them in a private class defined only within the cpp file, so you aren't constantly changing that header.
  • by lgw ( 121541 ) on Tuesday August 16, 2011 @03:20PM (#37110494) Journal

    Early on, the C++0x spec had "opt-in" garbage collection, which was perfect! You'd declare a pointer as a garbage collected pointer if you wanted that, but otehrwise no GC. That was useful for cyclic data structures, and otherwise you could ignore it.

    Sadly, missing from the final spec.

  • by Jeremi ( 14640 ) on Tuesday August 16, 2011 @04:00PM (#37111034) Homepage

    After a month of coding Java and never having to worry every time I typed "new" I never looked back.

    Modern C++ programmers don't need worry about typing "new" either; they use smart pointers to handle the "garbage collection" for them. Works great, and avoids the unpredictability, overhead, and performance problems of a garbage collection thread.

    (yes, I know it's possible for reference-counting to leak if you introduce a cycle into the graph. That said, in the last ten years of C++ program, that problem has bit me exactly zero times)

The trouble with the rat-race is that even if you win, you're still a rat. -- Lily Tomlin