Thread: C++0x ???

  1. #31
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Akkernight
    Ok, so C++ gave Object Oriented programming, right?
    Yes, C++ extended C with constructs to support object oriented programming natively, but no, it was not the first programming language to support object oriented programming natively.

    Quote Originally Posted by Akkernight
    Does C++0x give any such major thing?
    You can read that interview with Stroustrup that I linked to. Nonetheless, note that C++0x is not a new programming language, but a new edition of the C++ standard.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #32
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Lambdas o.o? Will that make physics calculation and stuff easier and more like the real stuff ^^? Love doing physics, if I do it right, if I get it wrong and just can't figure it out, I almost tear my hair out :P
    Currently research OpenGL

  3. #33
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Akkernight
    Lambdas o.o? Will that make physics calculation and stuff easier and more like the real stuff
    In this case lamdba refers to anonymous functions. The name is from lambda calculus, not physics.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #34
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Lambdas in C++0x allows you declare unnamed functions.
    Like
    Code:
    int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
    std::for_each(array, array + sizeof(array), [](int n) { std::cout << n << std::endl; });
    I don't know what you get wrong with physics, so I cannot really say...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #35
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    C++0x is like oiling an older machine. Much of the new standard is maintenance related from what I can tell - it does something about C++'s warts, introduces some new features; some good, some bad.

    C++ already has OOP. With the introduction of things like concepts, they're trying to introduce new types of abstraction. Abstraction is a programming tool in itself which helps make your programs express the algorithms they use to solve problems more clearly. As an obverse example, take a look at programs written in earlier versions of BASIC: very little abstraction meant that code was a pain to write and maintain.

    Sorry if I'm going on a tangent but that seems to be C++0x's purpose. In regards to the new standards name, I don't think the compiler would care if they called it C++Pudding. Maybe that's what it should be!

  6. #36
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    A lot is maintenance, I would say, a lot is new. And a lot is welcome.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #37
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    But even the new stuff is maintenance of a sort. Just like you add new features to a program as part of maintenance: you discovered issues with the software, now you're adding a new feature to make something that you really want to do possible or easier. C++0x is like that.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #38
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Perhaps. I suppose it is because the committee is lacking resources for a major overhaul? They're more looking for easy things to implement that does not require as much time or resources.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #39
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Hmm... This might sound stupid, 'cause I don't really know much :P but I got this results from accelerated C++

    File size list vector
    735 0.1 0.1
    7,350 0.8 6.7
    73,500 8.8 597.1

    And those look really drastic to me, so will C++0x also speed things like vector up? make it faster and stuff :P
    Those results are for inserting and erasing, correct me if I'm wrong :P
    Currently research OpenGL

  10. #40
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Perhaps. I suppose it is because the committee is lacking resources for a major overhaul? They're more looking for easy things to implement that does not require as much time or resources.
    "If it ain't broke don't fix it"? I don't want C++ to suffer from feature creep. In fact, a lot of things were proposed, and many of those were dismissed. But the published opinions from the committee seems like something one should read for themselves than asking a particular person here.

  11. #41
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Akkernight
    And those look really drastic to me, so will C++0x also speed things like vector up? make it faster and stuff :P
    Those results are for inserting and erasing, correct me if I'm wrong :P
    You are probably interpreting the results incorrectly. Different data structures have different trade offs.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  12. #42
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    In languages, it's not a new version if you break backwards compatibility, it's a new language (Python 3 notwithstanding). C++0x is a new version. They can't do anything drastic, because old code would stop working.

    (Minor incompatibilities are fine and pretty much unavoidable.)
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  13. #43
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Akkernight View Post
    Hmm... This might sound stupid, 'cause I don't really know much :P but I got this results from accelerated C++

    File size list vector
    735 0.1 0.1
    7,350 0.8 6.7
    73,500 8.8 597.1

    And those look really drastic to me, so will C++0x also speed things like vector up? make it faster and stuff :P
    Those results are for inserting and erasing, correct me if I'm wrong :P
    I'm afraid you do not understand how the standard works.
    They standard says how the implementation must work, but it is up to the compiler vendors themselves to create the implementation.
    So either you are using the wrong solution to the problem or you are using a compiler with a slow standard library.
    A new standard won't fix this.

    Quote Originally Posted by whiteflags View Post
    "If it ain't broke don't fix it"? I don't want C++ to suffer from feature creep. In fact, a lot of things were proposed, and many of those were dismissed. But the published opinions from the committee seems like something one should read for themselves than asking a particular person here.
    Indeed. Usually a good motto if you don't want to break anything.

    Quote Originally Posted by CornedBee View Post
    In languages, it's not a new version if you break backwards compatibility, it's a new language (Python 3 notwithstanding). C++0x is a new version. They can't do anything drastic, because old code would stop working.

    (Minor incompatibilities are fine and pretty much unavoidable.)
    Of course, a major overhaul does not necessarily mean change all the interface and break everything, but adding a lot of time-consuming features, perhaps. Or along the lines of something like that.
    Or maybe overhaul is the wrong word, but regardless. My point was that the committee is trying to take on easy tasks instead of big, complex ones due to somewhat limited resources.
    Is it funding or simply not enough people to help out that's really the issue? Does anyone know?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  14. #44
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Just so you people know, 'cause you seem to get it wrong :P but the book showed a test of why list is faster for some problems than vector
    Currently research OpenGL

  15. #45
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Depends on where and how it is used.
    There is no ultimate solution to all problems. Therefore, there is usually a solution to a specific amount of problems.
    Lists are good for insertion or deletion in the middle, but slow at traversing or iterating.
    Vectors are good for linear storing of data and a dynamic array, but are very poor at insertion or deletion in the middle.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed