Slashdot Mirror


Stroustrup Says New C++ Standard Delayed Until 2010 Or Later

wandazulu writes "At the end of an article written by the creator of C++, where he talks about removing a feature from the new C++ standard, he drops a bombshell: The new C++ standard (typically referred to as C++0x) has been delayed until 2010 or later. What does this mean? No new C++ features like threads, proper enum classes, or hash tables. C++0x is dead, long live C++1x!"

501 comments

  1. Namespace by Quiet_Desperation · · Score: 4, Funny

    C++0x

    Yes, well, that just rolls off the tongue, doesn't it?

    Maybe he can get one of those hieroglyphs like Prince.

    1. Re:Namespace by Anonymous Coward · · Score: 0

      Here are three guessess:

      See Plus Ox? (Dr Seuss' Teaching Hexidecimal)
      CCCOX? (The Porn Edition)
      seeplusplus zerox? (PC Load Letter, WTF does that mean?)

    2. Re:Namespace by Keyper7 · · Score: 4, Insightful

      The Language Formerly Known as C++

    3. Re:Namespace by Anonymous Coward · · Score: 1, Informative

      The language is still called C++. ALL languages use this idiom when referring to certain revision of a language. For example, before the last version of C was ratified, it was referred to as C9X. It's still called C, but you can talk about C90 vs C99.

    4. Re:Namespace by Anonymous Coward · · Score: 0

      Talking about names, if the language is delayed until at least 2010 shouldn't it be called C++1x?

    5. Re:Namespace by Zan+Lynx · · Score: 4, Funny

      No. Obviously it is C++0xa.

    6. Re:Namespace by ByOhTek · · Score: 2, Funny

      You forgot C-Pox, what you get, hopefully as a kid and not an adult.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    7. Re:Namespace by Anonymous Coward · · Score: 0

      Perhaps this more descriptive name: suC++ks

    8. Re:Namespace by chivesandbonbon · · Score: 3, Funny

      Looks like a dead fish.

    9. Re:Namespace by vikstar · · Score: 2, Funny

      C++0++x

      --
      The question of whether a computer can think is no more interesting than the question of whether a submarine can swim.
    10. Re:Namespace by Anonymous Coward · · Score: 0

      I attended a conference with Bjarne Stroustrup and he has been referring to it as C++09 or C++0A for a long time.

    11. Re:Namespace by Anonymous Coward · · Score: 0

      Nah, it's just X as in Roman numeral 10.

    12. Re:Namespace by dublindan · · Score: 1

      Haha good point!

    13. Re:Namespace by Quiet_Desperation · · Score: 1

      Stupid fag. They always do that when talking specific version of a language. Now go back you jerking off over your pathetic Java code.

      HOW DARE YOU!!!1!!

      I've *never* programmed a single line of Java code!

      Hmph!

  2. I know nothing about C++0x by Anonymous Coward · · Score: 0

    But I can assure you it's better than Cloud Computing with JavaScript :)

    1. Re:I know nothing about C++0x by ObsessiveMathsFreak · · Score: 1

      Well, it'll be faster at any rate.

      --
      May the Maths Be with you!
    2. Re:I know nothing about C++0x by JustinRLynn · · Score: 1

      If by "faster" you mean faster to execute and not faster to write or debug.

  3. C++0A by gr8_phk · · Score: 4, Funny

    Or C++0x0A no need to change the name.

    1. Re:C++0A by Anonymous Coward · · Score: 0

      I assume this is some leetspeak attempt to say Cocoa, which indeed is an improvement over C++.

    2. Re:C++0A by joss · · Score: 3, Funny

      Actually, that's what they're doing, its not a joke [my money's on C++0b though]

      --
      http://rareformnewmedia.com/
    3. Re:C++0A by Anonymous Coward · · Score: 0

      no need to change the name.

      Yes, no need, it was delayed , kids.

    4. Re:C++0A by Eddy+Luten · · Score: 3, Informative

      Cocoa is an API, Objective-C is the language.

    5. Re:C++0A by Unoriginal_Nickname · · Score: 2, Funny

      God only knows.

      My money's on C++xx

    6. Re:C++0A by Anonymous Coward · · Score: 1, Informative

      I assume this is some leetspeak attempt to say Cocoa, which indeed is an improvement over C++.

      Sigh, kids today. And I thought this was Slashdot. FYI, there is this cool numbering system called hexadecimal. It's base 16:

      D H AKA
      0 0 0x00
      1 1 0x01
      2 2 0x02
      3 3 0x03
      4 4 0x04
      5 5 0x05
      6 6 0x06
      7 7 0x07
      8 8 0x08
      9 9 0x09
      10 A 0x0A
      11 B 0x0B
      12 C 0x0C
      13 D 0x0D
      14 E 0x0E
      15 F 0x0F

      2010 , take 10 into Hexadecimal. Voila. Il est perfect, mon ami! Manger des bebes! Parler Klingoner! Il est mort, Jim!

    7. Re:C++0A by Anonymous Coward · · Score: 0

      That's debatable. The line between API and standard library is a fine one. How many languages are just C or C++ syntax with a different (more complete?) standard library and maybe an added keyword or two?

    8. Re:C++0A by Imagix · · Score: 1

      That was the running joke a while ago... the next standard is C++0x where x will be the year that it's final. Hopefully we won't have to use a hex digit for the x. Well, it would now appear that we wil have to use a hex digit....

    9. Re:C++0A by Elektroschock · · Score: 2, Informative

      Oh, and there is gnustep.

    10. Re:C++0A by Zan+Lynx · · Score: 1

      Taking your last line and thinking about it, I now believe we should call it C++0x7da.

    11. Re:C++0A by CastrTroy · · Score: 1

      However, if you are going to use hex to denote the year, then 2010 should be 7DA. 20A would not interpreted as 2010.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    12. Re:C++0A by Wildclaw · · Score: 4, Funny

      My big question.

      The original demonic summoning of the C++ spec was done using a piece of the tower of babel, a succubus and 2 top laywers arguing over who shouldn't be sacrificed. What ingredients were they using this time, and why did it fail?

    13. Re:C++0A by geniusj · · Score: 1

      Technically it could be a hex digit now! ;-)

    14. Re:C++0A by rdnetto · · Score: 1

      They forgot to write out the DMCA in blood.

      --
      Most human behaviour can be explained in terms of identity.
    15. Re:C++0A by dublindan · · Score: 1

      My moneys on C++0x++
      Gotta keep with the theme here.

    16. Re:C++0A by Anonymous Coward · · Score: 0

      The original demonic summoning of the C++ spec was done using a piece of the tower of babel, a succubus and 2 top laywers arguing over who shouldn't be sacrificed

      Ah, yes! Now I know why I like reading the spec so much.
      Yours,
      The Devil In The Details

  4. Well, it could... by Petersko · · Score: 5, Funny

    "C++0x... Yes, well, that just rolls off the tongue, doesn't it?"

    Well, it does if you just pronounce it "Cocks".

    1. Re:Well, it could... by Anonymous Coward · · Score: 0

      Could we tag this story "cocksplusplus"?

    2. Re:Well, it could... by Steneub · · Score: 1, Funny

      I guess in your case though it sort of rolls on to the tongue.

    3. Re:Well, it could... by Bemopolis · · Score: 5, Funny

      If the cock rolls off your tongue you're doing it wrong.

      --
      "I guess the moral of the story is, don't paint your airship with rocket fuel." -- Addison Bain
    4. Re:Well, it could... by dgatwood · · Score: 1

      Well, it does if you just pronounce it "Cocks".

      The plusses are silent.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    5. Re:Well, it could... by Anonymous Coward · · Score: 0

      Cocks, the future of programming as we know it.

    6. Re:Well, it could... by Anonymous Coward · · Score: 0

      note to self:
      patent personal business processes like holding cock while programming
      just in case they become future of business.

    7. Re:Well, it could... by Darinbob · · Score: 2, Funny

      No, the pluses are pronounced "up". As in "cocks up".

    8. Re:Well, it could... by Anonymous Coward · · Score: 0

      Just think of the pair programming, just think.. XXXP is the proper name for this monstrosity.

    9. Re:Well, it could... by stuntpope · · Score: 1

      I guess they do it right in Soviet Russia....

    10. Re:Well, it could... by colinrichardday · · Score: 1

      Well, it does if you just pronounce it "Cocks".

      Will Stoustrup be teaching this at the University of South Carolina?

  5. Re:How about a REAL C++ feature.... by EkriirkE · · Score: 2, Insightful

    Because this is obviously the language's fault.

    --
    from 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    to 45 2F 6E 40 3C DF 10 71 4E 41 DF AA 25 7D 31 3F
  6. Not a bombshell by shutdown+-p+now · · Score: 4, Informative

    It's not a bombshell by a long measure. Anyone who had been tracking C++0x standardization process (reading comp.std.c++, and WG papers) knows that the goal of getting the standard out by 2010 was fairly unrealistic, mostly because of concepts. The joke that "x" in C++0x is actually a hex digit and not decimal has been around for several years now.

    1. Re:Not a bombshell by Anonymous Coward · · Score: 0

      Conceptswere dropped from the proposed standard this month:

      ddj
      wipipedia

    2. Re:Not a bombshell by shutdown+-p+now · · Score: 1

      I know, that's what the TFA is about. The point is that it was mostly concepts that have mostly delayed the standardization process until now.

    3. Re:Not a bombshell by rkit · · Score: 1

      Yawn. The first time I read this hex joke was about FORTRAN8x.

      --
      sig intentionally left blank
    4. Re:Not a bombshell by Kensai7 · · Score: 1

      I agree.

      This is actually a good thing. Having that stupid deadline of 31 December 2009 was actually pushing the ISO teams to work by tossing many features or issues that otherwise might have gotten in. When the new C++ is out, it better be complete and stable for the next 10 years. What matters is this: have a complete standard so compiler producers won't need to add that many custom features.

      --
      "Sum Ergo Cogito"
    5. Re:Not a bombshell by Anonymous Coward · · Score: 0

      mostly because of concepts

      I think that Bjarne specifically mentioned in the linked article that this criticism is unfair in his opinion. It feels like a lot of committee members got spooked by the idea that the standard would be completed in 2011 or 2012 instead of 2010 or 2011. They've spent long enough already that IMHO, they should have voted to fix them instead. I mean, hell, most major compilers already have support for MOST of the draft standard.

    6. Re:Not a bombshell by shutdown+-p+now · · Score: 1

      I mean, hell, most major compilers already have support for MOST of the draft standard.

      Did you read the paper I've linked to in my previous post in the thread? Most compilers have support for most of the new language features - except for concepts. First, because the implementation cost of concepts absolutely dwarfs everything else combined, and second, because concepts were a moving target - every time they fixed something, some other ugly problem raised its head. The only testbed for concepts was ConceptGCC, and that hasn't been updated in a while (so effectively they didn't have an implementation of more recent proposals).

      Now, I do agree that they should have swallowed that up, and take their time - however much it takes - to iron out everything, and deliver working concept spec. But there's no argument that it would take much longer.

  7. in related news... by cowdung · · Score: 5, Funny

    The latest version of Cobol (eagerly expected by 6 people) will also be delayed till January 2011.

    1. Re:in related news... by oldhack · · Score: 2, Funny

      God damn it!

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    2. Re:in related news... by Anonymous Coward · · Score: 0

      I can just picture the disappointment.

    3. Re:in related news... by clintp · · Score: 4, Funny

      No worries. C++1x will still be out before Perl 6.

      --
      Get off my lawn.
    4. Re:in related news... by Anonymous Coward · · Score: 1, Insightful

      ... and both will be out after Python 4000...

    5. Re:in related news... by peater · · Score: 1

      I'm just hoping my Eclipse installation boots up before either of the above so I can learn some Java before I get my hands dirty with C++1x and my mind dirtier with Perl 6.

    6. Re:in related news... by Anonymous Coward · · Score: 0

      Yes, but once Perl6 and Parrot are done, you'll just run C++ on Parrot!

    7. Re:in related news... by Anonymous Coward · · Score: 0

      Well, it would be late for only a few months then (2010 is the current target, according to Wikipedia).

    8. Re:in related news... by Anonymous Coward · · Score: 0

      Who are these six people? Go on, name them. Hah, I knew you couldn't.

    9. Re:in related news... by barberousse · · Score: 1

      Parrot is already at version 1.0 ...

    10. Re:in related news... by ioshhdflwuegfh · · Score: 1

      ... and both will be out after Python 4000...

      but still before Python 10000.

    11. Re:in related news... by Anonymous Coward · · Score: 0

      The latest version of Cobol (eagerly expected by 6 people) will also be delayed till January 2011.

      I protest...the snide remark against Cobol. Long Live Cobol. :-)

    12. Re:in related news... by fowe · · Score: 1

      lol! you can say that again..., it seams the culture behind the two languages are similar :)

  8. Re:How about a REAL C++ feature.... by ardor · · Score: 5, Insightful

    Or a crowbar for anybody who thinks languages make things automatically safe.

    If you are a good programmer, you can do safe programs in C++ or any other language.
    If you are a bad programmer, you can't do that in C++ or any other language.

    --
    This sig does not contain any SCO code.
  9. Poorly worded by Anonymous Coward · · Score: 1, Interesting

    "No new C++ features like threads, proper enum classes, or hash tables"

    "Concepts" is the only thing being removed from the new standard due to time constraints (which is a shame since they seemed like a great new feature).

    I think you meant to say 'No new C++ features .... _until next year at the earliest_'

    Of course if you want to try some of the new features in the meantime feel free to checkout the expiremental branch of gcc geared towards implementing C++0x.

  10. Headline misses the point completely by Anonymous Coward · · Score: 5, Informative

    The headline completely misses the central part of the article and focuses on a very minor point. Everyone has known for quite a while that C++0x would actually be C++1x. There's only a few months left in 2009, so there's absolutely no surprise there. The real meat of the article is that support for "concepts", a key (and arguably the most anticipated) part of C++0x, is being dropped. That's a major disappointment to many people, including Stroustrup.

    1. Re:Headline misses the point completely by ardor · · Score: 4, Insightful

      Yeah, but it is reasonable. Concepts are a complex feature, and C++ is an (overly) complex language. Do you really want to hold back all the other very important features like lambda, rvalue references, variadic templates, type deduction etc. just because of concepts?

      --
      This sig does not contain any SCO code.
    2. Re:Headline misses the point completely by Anonymous Coward · · Score: 0

      Sure it is reasonable, but that doesn't make it any less disappointing. The criticism was directed to the headline, not the content of the article.

    3. Re:Headline misses the point completely by zindorsky · · Score: 1

      Concepts are (were) cool. But let's be realistic: unless you're doing a lot of template library programming, you wouldn't use them much.

      I think much cooler additions are lamda functions, move semantics (rvalue references), auto keyword and others. Also additions to the standard library like threading and decent smart pointers.

      --
      If the geiger counter does not click, the coffee, she is not thick.
    4. Re:Headline misses the point completely by Alef · · Score: 1

      Concepts are a complex feature, and C++ is an (overly) complex language.

      Concepts is also a feature that could help managing the complexity of C++, for instance making template libraries much easier to use by giving sane compiler errors. You might still have to be an expert to write a GP library, but you shouldn't have to be one to use such a library.

    5. Re:Headline misses the point completely by serviscope_minor · · Score: 1

      C++ is an (overly) complex language.

      No it is not. If it was, there would be simpler/better replacements for features that it has. Back up your statemant. Name one feature you could remove from C++ without ruining it. I strongly suspect I will be able to come up with a counter argument.

      Apart from tmeplace export that noone uses anyway :-)

      --
      SJW n. One who posts facts.
    6. Re:Headline misses the point completely by jpmorgan · · Score: 3, Insightful

      Absolutely. C++ is a very complex language, and concepts were a feature that was going to be critical in reducing that complexity.

    7. Re:Headline misses the point completely by jpmorgan · · Score: 2, Insightful

      No, concepts weren't for the developers of big template libraries, it was for the users. There are large portions of boost which are powerful and useless to your average programmer, because simple mistakes lead to impenetrable error messages.

    8. Re:Headline misses the point completely by Anonymous Coward · · Score: 0

      I don't really see how your argument relates to that statement. I could attach a screwdriver to a hammer and I really could use both of its functions very often, yet it is overly complex.

      Just take a look at boost. Boost is implemented in C++ and shows that way how powerful it is. Yet it also shows how simple stuff could be implemented in contrast to the standard C++. Just take a look at boost signals. It shows how easy it should be to use callbacks in OOP. In contrast just imagine how you would write a class that allows subscription of callbacks, like for example some server object that notifies clients of some event. Tell with a straight face that this is not overly complex.

      You are right that you can't remove a single feature without crippling it. But that actually shows the problem. Remove one feature and a whole bunch of other features can't be used properly. Every feature depends on other features, this is complexity.

      Meanwhile in other languages stuff is simple. For example in every other language it is quite intuitive to use callbacks. You just pass the function that should be called and the compiler understands that. In C++ you have to at least bind it to an instance. A whole line of code that could be easily made redundant. That is overly complex.

    9. Re:Headline misses the point completely by maxwell+demon · · Score: 1

      Depends on what you consider "ruining" it. Things I'd like to be removed from C++ (but backwards compatibility disallows it):
      * writing reinterpret_casts as constructor-style casts (constructor-style casts should be restricted to static/const cast)
      * implicit decay of arrays to pointers (yes, that's a C feature inherited by C++; arrays should be first-class objects)
      * implicit conversion from bool to int (explicit conversion should stay)
      * C++ declaration syntax (of course by being replaced with a more sane syntax; this would also save us from writing "typename" and "template" inside templates just to disambiguate the grammar; but just not having C++'s most vexing parse would be a big advantage)
      * local declaration of global functions

      --
      The Tao of math: The numbers you can count are not the real numbers.
    10. Re:Headline misses the point completely by snaz555 · · Score: 1

      * implicit decay of arrays to pointers (yes, that's a C feature inherited by C++; arrays should be first-class objects)

      It would take significant changes to the language to allow removal of pointers and arrays. Most current attempts to do so simply punt all the details onto the underlying allocator, which doesn't have sufficient information to do a good job. As an example, an ethernet I/O buffer might need to be allocated in a memory region mapped onto the device that implement the interface chosen by IP as the output interface - cached by TCP for a connection. And some ethernet devices might have such memory mapped buffer areas; others don't. Implementing this in the allocator requires carrying a lot of random baggage (context) up and down the call tree. It easily results in difficult to resolve catch-22 situations that will then impose design restrictions that actually prevent simple and straightforward implementations. And then you still have layout restrictions like how you want the IP header aligned on top of the PHY framing. In the end you'll likely find pointers and arrays used to implement containers that provide all the necessary functionality and that can be mocked and unit tested really is the better solution.

    11. Re:Headline misses the point completely by Zeinfeld · · Score: 1
      Yeah, but it is reasonable. Concepts are a complex feature, and C++ is an (overly) complex language. Do you really want to hold back all the other very important features like lambda, rvalue references, variadic templates, type deduction etc. just because of concepts?

      Hell yes.

      Actually I would like to hold back concepts as well.

      Then take out templates and multiple inheritance and classes.

      And merge the result with randomly chosen features from AWK and FORTRAN.

      There is a serious purpose here. There comes a time when the best thing to do with a computing language is to phase out use. C++ has all the disadvantages of C and none of the advantages. Like the name says - increment by one and use the old value

      At this point we have two mainstream successors to C that offer more functionality with less clutter. If you want to do object oriented programming you use Java or C# (or Objective C on the Apple platforms). They have object systems that make sense. C++ is the product of confused minds. Its something you want to avoid for fear of contamination. At least with COBOL you can get paid big bucks for turning out the code.

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    12. Re:Headline misses the point completely by maxwell+demon · · Score: 1

      I didn't advocate removing pointers and arrays, or even just one of them. I was advocating removing the decay of arrays to pointers. That is, keep pointers as they are (well, there could be improvements in that area, too, but that's a separate concern), keep arrays, but make arrays first-class objects which don't decay to a pointer to the first element. If you need a pointer to the first element, you can always get it explicitly: &a[0]

      And yes, I do know that this isn't really possible, because it would break B compatibility (no, that's no typo; the way C arrays work is originally due to B compatibility, since C++ inherits them from C, it's restrained by B compatibility as well).

      --
      The Tao of math: The numbers you can count are not the real numbers.
    13. Re:Headline misses the point completely by ardor · · Score: 1

      If you want to take out templates and multiple inheritance, you do not understand what templates are actually used for nowadays. Please look up: generic programming, template metaprogramming, modern C++ (no, 1995 style C++ is not modern) and then come back. Generic programming alone is so powerful it becomes obvious why C++ is headed in this direction. And no, neither C# nor Java support GP (their generics are far too primitive).

      This comes from someone who uses C++ for a living. Note that C++ is full of problems. You identified none of them though, and none of your statements are correct.

      --
      This sig does not contain any SCO code.
    14. Re:Headline misses the point completely by MadKeithV · · Score: 1

      If you want to do object oriented programming you use Java or C# (or Objective C on the Apple platforms). They have object systems that make sense.

      One of the BIG things about C++ is that it is multi-paradigm. If I want to do some object-oriented programming, but not all the time (because it is no silver bullet), C++ is a choice that is extremely well-supported on many platforms.

    15. Re:Headline misses the point completely by Anonymous Coward · · Score: 0

      Emphatically, absolutely agree! If they could work out the usability issues with concepts, the language (and particularly the standard library) was going to become much easier to grok.

    16. Re:Headline misses the point completely by shiftless · · Score: 1

      No it is not. If it was, there would be simpler/better replacements for features that it has.

      There is--it's called C#.

      C++ is a horribly broken language that should have been relegated to the scrap heap long ago. Not really interested in reading any counter arguments you may care to make, as there is nothing you can possibly say that can convince me this language isn't a POS.

  11. And nothing of value was lost by Anonymous Coward · · Score: 1, Insightful

    Why the #$%! do computer scientists believe that languages are like movies and you need to release a sequel? There is nothing they can add to any language that cannot be done effectively with C and C++ with a good support library like BOOST and STL. Language-specidic Threads? Enum classes? Hash tables? All of those are ALREADY possible without another language being introduced.

    The purpose of new languages? To sell books. To sell compilers. To keep academics publishing about their new inventions. But lets face it, we have enough languages now. If you can't accomplish what you want to do in a relatively short time with the options that are now available, the problem isn't the language.

    1. Re:And nothing of value was lost by ardor · · Score: 3, Informative

      Are you saying that C++0x is unnecessary?

      If so, then you haven't stumbled upon C++'s many problems. Like, lack of rvalue references. Or, lack of a proper lambda.

      --
      This sig does not contain any SCO code.
    2. Re:And nothing of value was lost by Anonymous Coward · · Score: 0

      Did you even look at some of the new features. I'm eagerly awaiting llamda functions, initializer lists, and the 'auto' keyword for one.

    3. Re:And nothing of value was lost by Random+Person+1372 · · Score: 1, Insightful

      Why the #$%! do programmers believe that operating systems are like movies and you need to release a sequel? There is nothing they can add to any operating system that cannot be done effectively with Windows 3.1 with a good virus scanner. Multitasking? Network support? Memory protection? All of those are ALREADY possible without another operating system being introduced.

      The purpose of new operating systems? To sell licenses. To sell books. To keep journalists publishing about their new registry tricks. But lets face it, we have enough operating systems now. If you can't accomplish what you want to do in a relatively short time with the options that are now available, the problem isn't the oeprating system.

    4. Re:And nothing of value was lost by speedtux · · Score: 2, Insightful

      If so, then you haven't stumbled upon C++'s many problems. Like, lack of rvalue references. Or, lack of a proper lambda.

      I think \bigger problems are C++'s complexity, the presence of pointers, the use of include files, and the lack of garbage collection.

    5. Re:And nothing of value was lost by Metasquares · · Score: 1

      If you can't move forward, you'll surely fall behind. We have new ways of doing things which have the potential to make all of our lives easier. Our tools must evolve with us, or we must find new ones.

    6. Re:And nothing of value was lost by shutdown+-p+now · · Score: 4, Insightful

      There is nothing they can add to any language that cannot be done effectively with C and C++ with a good support library like BOOST and STL.

      The whole point of concepts was to make C++ libraries that heavily rely on templates, such as STL and Boost, easier to use. As it is, C++ templates are effectively compile-time duck typing, which means that error is reported not at point of call, but where it actually leads to non-compilable code produced during template instantiation (which is usually inside the library you're calling). Ever made a mistake while calling boost::bind (or, Heaven forbid, while using Boost lambdas)? Do you remember what the error message looks like when it happens?

    7. Re:And nothing of value was lost by Tacvek · · Score: 2, Informative

      C++0x is just an evolution of C++. It does not add anything that is not already possible, but it does attempt to improve certain usecases. Adding threading support to the language core allows the standard library to be used with threading, and makes it easier to write thread-safe code. (As it is, you need to look up for each and every compiler/standard library pair you use which if any standard library functions are threadsafe.)

      The hash-based containers have been fairly standard since the beginning, although there were slight incompatible differences between the implementations, which meant that portibility suffered if you used them. Now adopted by the Standard Library, you can use them in any C++ implementation that support C++0x (Which will be most of them. Even Microsoft plans to strive for a fully complaint implementation, minus a small number of legacy deviations (although they will always remain fairly far from perfect compliance)).

      Much of the standardization effort is in bringing chunks of BOOST into the standard library, such that you can just use them without installing all of BOOST (which is pretty extensive). They are adding a few nice convenience features, such as lambdas (really useful with STL algorithms), and a few other features.

      Just like any decent C compiler supports C99, all good C++ compilers will support C++0x. It is highly backwards compatible, although a few minor breakages will be present, especially if you use one of the few new keywords as an identifier.

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    8. Re:And nothing of value was lost by Anonymous Coward · · Score: 0

      Then use Java, or something else that satisfies your requirements. If you need garbage collection then use a language that provides it. If you need pointers, obviously you don't, then use a language that provides them. I'm sick of these my language is better than your language arguments. They usually involve programmers who have little or no experience in any other language, or programming paradigm for that matter, other than the one they think is best. My friend keeps telling me how awesome his programming language of choice is when it's the only one he knows!

    9. Re:And nothing of value was lost by Joce640k · · Score: 2, Insightful

      Funnily enough, all the features you mention are ones which CAN be fixed with "a good support library".

       

      (Apart from the include files...)

      --
      No sig today...
    10. Re:And nothing of value was lost by Anonymous Coward · · Score: 0

      Please get a clue or stfu ;)

      C++ supports GCs (f. google it)

      Stop FUD.

    11. Re:And nothing of value was lost by serviscope_minor · · Score: 1, Interesting

      lack of garbage collection.

      Really. I hear this a lot yet I have yet to believe it. C++ creates very little garbage because of destructors. If you're fooling around with new and delete then you are a poor C++ programmer. Smart pointers fill pretty much all of the gaps. The remaining one is where you have mutable cyclic graphs. The only way of cleaning them up is with a scheme that equates to garbage collection. I don't think I have ever had one of those in any program I have ever written.

      --
      SJW n. One who posts facts.
    12. Re:And nothing of value was lost by Stele · · Score: 5, Interesting

      I think bigger problems are C++'s complexity, the presence of pointers, the use of include files, and the lack of garbage collection.

      Funny - I see all of those things as advantages.

    13. Re:And nothing of value was lost by JSBiff · · Score: 1

      Uhh, can you clue a programming newbie in. . . what's wrong with include files? I'm sure they can be abused, like any other feature, but aren't there good reasons C and C++ have been using include files for 20 or 30 years?

    14. Re:And nothing of value was lost by Anonymous Coward · · Score: 0

      I think \bigger problems are Java programmers who want C++ to be like Java, as you say : garbage collected, high-level, without pointers ; and, as you don't : slow, unnecessarily verbose, inable to do low-level, inable tu run without a heavy JVM (which is coded in C, not Java).

    15. Re:And nothing of value was lost by asc99c · · Score: 1

      I guess the problem is an include is effectively including the contents of the file you specify, which like you say can be abused. You can stick C functions in a file that is included into multiple other files, which gives you multiple copies of the function. What you should probably have done is just included an extern declaration into the other files and only have one copy of the actual function definition.

      In Java the includes are just telling the compiler where to look for stuff - e.g. including javax.swing.JPanel means you can just type JPanel in the rest of the code, instead of always fully qualifying that you mean javax.swing.JPanel. You can't make a lot of the mistakes you could probably make with includes.

      But as with all the other problems quoted by the GP, I'm not sure any of them are big problems for decent programmers. And I've generally seen that bad programmers can cause havoc without resorting to anything as complex as dodgy pointer arithmetic. (Except I quite like garbage collection, since 99% of the time it means that programmers of any ability don't need to think about that aspect of the coding, thus saving time)

    16. Re:And nothing of value was lost by Twinbee · · Score: 1

      D solves a lot of that quite efficiently.

      --
      Why OpalCalc is the best Windows calc
    17. Re:And nothing of value was lost by Joce640k · · Score: 1

      If you have cyclic graphs then you're using the wrong sort of pointer.

      Smart pointers should only be used where a resource is being managed, not for creating links between objects - use a weak pointer for that (or even a plain old C pointer).

      --
      No sig today...
    18. Re:And nothing of value was lost by Joce640k · · Score: 3, Insightful

      The big problems with GC are:

      a) Resources are more than just RAM. All files, network connections, etc., have to be manually closed in Java. There's no way to automate this (no equivalent to C++ stack unwinding) and it ends up being more work than managing RAM in C++ (where the compiler does 99.99% of the work for you).

      b) Even if you're only managing RAM, a garbage collector will totally destroy your performance if you run out of it and start paging to disk. To me, anything which continually scans the entire heap when you're out of RAM is a showstopping problem and makes GC useless for real applications.

      --
      No sig today...
    19. Re:And nothing of value was lost by DragonWriter · · Score: 1

      Are you saying that C++0x is unnecessary?

      If so, then you haven't stumbled upon C++'s many problems.

      Really? I would think it was certainly possible for someone who has stumbed upon C++'s many problems to come to the conclusion that C++ was unnecessary, and, consequently, that C++0x was also unnecessary.

    20. Re:And nothing of value was lost by jamesswift · · Score: 1

      "It does not add anything that is not already possible"

      I can understand why this might seem so but, whilst a lot of it is standardising things that have become popular in the real world, which is a good thing imho, rvalue references are an example of something new which is currently impossible.

      http://en.wikipedia.org/wiki/C%2B%2B0x#Rvalue_reference_and_move_semantics

      --
      i wish i could stop
    21. Re:And nothing of value was lost by Crimsonjade · · Score: 1

      Just like any decent C compiler supports C99, all good C++ compilers will support C++0x.

      gcc must not be a decent compiler then.

    22. Re:And nothing of value was lost by RiotingPacifist · · Score: 1

      If you want gc then, C/C++ are not the languages you are looking for!

      --
      IranAir Flight 655 never forget!
    23. Re:And nothing of value was lost by Zeinfeld · · Score: 1
      Are you saying that C++0x is unnecessary? If so, then you haven't stumbled upon C++'s many problems. Like, lack of rvalue references. Or, lack of a proper lambda.

      Not necessarily, he might just want C++ to die.die.die.

      I have not stumbled on many of C++s problems after taking a look at it in the 80s and deciding it was the work of confused minds, to be avoided at all costs.

      FORTRAN has its problems as well. Shouldn't we fix that first?

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    24. Re:And nothing of value was lost by Philip_the_physicist · · Score: 1

      It is an easily-abused feature, which is a fairly common argument for removing/omitting a feature from a language (just look at the argument over operator overloading in Java).

      Personally, I am in favour of them.

    25. Re:And nothing of value was lost by ardor · · Score: 1

      A GC is a useful feature though, because it frees us from having to distinguish between heap and stack, and more importantly it frees us from having to deal with the lifespan of a variable directly being related to the stack. The way programs are written nowadays often does not work well with stack lifespans. Yes, if done properly, this is a non-issue in 90% of the time (because of shared_ptr for dynamic stuff), however there are cases where a GC would have been great.

      --
      This sig does not contain any SCO code.
    26. Re:And nothing of value was lost by ardor · · Score: 2, Insightful

      Include files are used as some sort of interface 99% of the time. Count the amount of include files without include guards. This means that include files are used in one limited way almost always. If headers are used like module interfaces, then it would be better to support modules in the first place.

      Plus, you have to manually take care that stuff isn't defined multiple times (which can happen even with include guards), templates have to be re-evaluated all the time, headers included in include files propagate and can affect compile time as well....

      As for why they are still around: backwards compatibility...

      --
      This sig does not contain any SCO code.
    27. Re:And nothing of value was lost by ardor · · Score: 2, Insightful

      No, because there is nothing that can replace it. Look at the range it covers. Give me a language that can replace this, and I'm truly happy, because C++ is not a shining beacon of light, C++ is a necessary evil until something can truly replace it.

      Oh, and mind the amount of C++ code out there I'd need to interface with. D is the closest thing out there, but it still falls short (well, perhaps until D 2.0 comes out).

      --
      This sig does not contain any SCO code.
    28. Re:And nothing of value was lost by WNight · · Score: 1

      They're a needless duplication of code.

      It's funny how you've gotten five different answers.

    29. Re:And nothing of value was lost by msclrhd · · Score: 1

      A garbage collector won't help with:

      for (int i = 1; i 10; ++i)
      {
              File file("hello.txt");
      }

      C++ world -- happy (destructor closes file)
      Garbage collected world -- file still locked on second iteration as garbage collector hasn't cleaned up the file object (and you still need to explicitly close the file)

      Not saying that C++ is perfect, but garbage collection isn't the answer people think it is. Not to say about memory usage, and performance when the garbage collector is invoked.

    30. Re:And nothing of value was lost by asc99c · · Score: 1

      I had always thought a garbage collector was just memory management anyway. Having garbage collection as a 'replacement' for destructors is not always that great. But dealing with files and network connections does take a bit more thought than dealing with blocks of memory anyway.

      Regarding point b) my main work is writing real-time systems (well, PLC engineers might well complain it's not really real-time stuff ...), and yeah issues like that make it very hard to use Java for the task. I have seen it done and I don't think it works well 100% of the time.

    31. Re:And nothing of value was lost by master_p · · Score: 1

      As a long time C++ developer, I can say the lack of proper lambda functions is a big issue, but why do you say rvalues is an equally big issue? I never ever needed something like rvalues, nor have I seen somewhere someone claiming so (unlike lambda functions which is an often requested feature).

    32. Re:And nothing of value was lost by master_p · · Score: 1

      But the compiler has all the instantiation tree at hand - it could simply reverse the reporting order and project the missing or incompatible code at the point of the declaration of the template instantiation.

    33. Re:And nothing of value was lost by blancolioni · · Score: 4, Informative

      anything which continually scans the entire heap when you're out of RAM is a showstopping problem and makes GC useless for real applications.

      Luckily, GC has advanced since the 1960s.

    34. Re:And nothing of value was lost by kraut · · Score: 1

      There are garbage collectors for C++ if you really want them.

      http://www.hpl.hp.com/personal/Hans_Boehm/gc/

      --
      no taxation without representation!
    35. Re:And nothing of value was lost by gbjbaanb · · Score: 1

      I only count 1 answer, and 4 comments.

      includes are like an interface, the menu not the meal, so you know what you'll be getting when you use that class.

      'modern' languages do away with this and effectively fold the header into the source, but then they also ship with features like reflection that allow you to access the stuff you'd normally put in the header file anyway.

      So it comes down to : do you as a dev write a header, which is efficient for the compiler to use (subject to complexity of the language!), or do you allow the compiler to generate it for other tools to display to the user. Its a classic trade-off between 5 minutes of developer time v no developer time but added compiler resource, binary and tool usage.

      Personally, I prefer to spend the few moments it takes, but then I was never so lazy at doing my coding 'right' to care about a couple extra minutes of my time.

    36. Re:And nothing of value was lost by petermgreen · · Score: 1

      The philosophy of garbage collection is that stuff gets cleaned up when the GC gets arround to it or ram is running out. This is tolerable (though IMO not ideal) for ram but not for most other resources.

      The philosophy of C++ destructors and reference counting is that stuff gets cleaned up as soon as it is no longer used. This means it can be used to manage any type of resource.

      The result is in GC environments for a lot of objects you end up doing a cleanup step manually. Worse if an object needs a cleanup call it's owner and it's owners owner and so on will also need manual cleanup.

      The result is a mess where you have to constantly remember whether any particular object needs manual cleanup or not and a huge ammount of refactoring work if an object that didn't previously need manual cleanup now does so.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    37. Re:And nothing of value was lost by petermgreen · · Score: 1

      use a weak pointer for that (or even a plain old C pointer).
      The trouble with plain pointers is they can go stale. If a stale pointer gets inadvertantly written through very bad things that are very hard to debug can happen.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    38. Re:And nothing of value was lost by kamatsu · · Score: 1

      --std=c99?

    39. Re:And nothing of value was lost by ioshhdflwuegfh · · Score: 1

      FORTRAN has its problems as well. Shouldn't we fix that first?

      It's being fixed constantly: FORTRAN IV, 77, 80(something), 90, 95, 2000,....

    40. Re:And nothing of value was lost by shutdown+-p+now · · Score: 1

      They usually do that - when reporting errors, you don't see a single line number, but a stack of line numbers from the point where instantiation started to the point where it failed. However, this gets messy real soon if there is more than one instantiation (which is usually the case - e.g. you instantiate container which instantiates iterator which instantiates some helper which fails), and you still don't get a coherent error message such as "You passed a single-argument function object to bind, and tried to bind two arguments". Instead you get some bit about overload resolution failure in some obscure implementation detail class in STL headers that you've never heard about.

    41. Re:And nothing of value was lost by BenoitRen · · Score: 1

      Spoken like a programmer that has to be protected from himself/herself. C++ adheres to the philosophy that the programmer should be able to use the full power available.

    42. Re:And nothing of value was lost by Tacvek · · Score: 1

      I did not say the compiler would have perfect support for it. 'gcc --std=c99' includes everything that realistically gets used. The fact of the matter is that there does not exist a single fully compliant C++ compiler either. Comeau C++ with the Dinkumware library comes really close, but it still has issues.

      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    43. Re:And nothing of value was lost by speedtux · · Score: 1

      Resources are more than just RAM. All files, network connections, etc., have to be manually closed in Java

      Java? Who said anything about Java???

      There's no way to automate this (no equivalent to C++ stack unwinding)

      Many garbage collected languages have unwind-protect or equivalents.

      Even if you're only managing RAM, a garbage collector will totally destroy your performance if you run out of it and start paging to disk.

      Garbage collectors often have lower overhead and less fragmentation than the C++ heap. Or did you think that memory management somehow was performed by fairies in C++?

      To me, anything which continually scans the entire heap when you're out of RAM is a showstopping problem and makes GC useless for real applications.

      You don't have a clue how real-world garbage collectors work, do you.

      You also seem to be mistaking garbage collection for some kind of convenience feature. Garbage collection is not about convenience, it is about safety. You cannot have a safe language and manual storage management. In fact, if you want efficiency, memory management usually is about as much work in a garbage collected language as it is in C++. The difference is that when you're done, the GC'ed program doesn't have safety issues, and it often performs better too.

    44. Re:And nothing of value was lost by speedtux · · Score: 1

      Spoken like a programmer that has to be protected from himself/herself.

      Yes. After 20 years and a couple of million lines of C++ programming, that's something I freely and fully admit.

      C++ adheres to the philosophy that the programmer should be able to use the full power available.

      And that philosophy appeals to programmers who have never outgrown the code jockey stage.

    45. Re:And nothing of value was lost by speedtux · · Score: 1

      You mean like:

      for i in range(10):
              with open("my.txt") as file:
                      do_something(file)

      Not saying that C++ is perfect, but garbage collection isn't the answer people think it is.

      Garbage collection is primarily a safety feature, not a convenience feature.

      Not to say about memory usage,

      Generally lower, since there is less fragmentation. The C++ storage allocator has far fewer ways in which to reduce fragmentation.

      and performance when the garbage collector is invoked.

      Generally better, because memory management is done more efficiently in batches.

    46. Re:And nothing of value was lost by BenoitRen · · Score: 1

      And that philosophy appeals to programmers who have never outgrown the code jockey stage.

      Nonsense. It's called taking responsibility for what you do.

    47. Re:And nothing of value was lost by Anonymous Coward · · Score: 0

      Choosing C++ as a programming language is the opposite of "taking responsibility". It virtually guarantees crashes, security holes, and bloat.

    48. Re:And nothing of value was lost by nidarus · · Score: 1

      I think bigger problems are C++'s complexity, the presence of pointers, the use of include files, and the lack of garbage collection.

      Funny - I see all of those things as advantages.

      I get why you'd like pointers and the lack of GC, and there might something good about include files as well (could you please tell me what, btw?), but what's so great about complexity?

      "Complex" and "powerful" aren't the same. "Complex", in this context, basically means "hard to understand". Why's that so great? Scares off the n00bs?

    49. Re:And nothing of value was lost by DragonWriter · · Score: 1

      No, because there is nothing that can replace it. Look at the range it covers.

      Why do we need one language that can do all the things C++ is used for moderately well (but with all the headaches of C++), rather than languages that are the right tool for each specific task, bound together, where necessary, by an appropriate architectural infrastructure (whether a common VM and calling conventions, or a message-based integration layer, or something else) for the higher level task at hand?

  12. Buffer overflow by tomasd · · Score: 2, Funny

    There will be buffer overflow after C++0xFF

    1. Re:Buffer overflow by EkriirkE · · Score: 1

      But we are no longer in the 1970s

      --
      from 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
      to 45 2F 6E 40 3C DF 10 71 4E 41 DF AA 25 7D 31 3F
    2. Re:Buffer overflow by Procasinator · · Score: 3, Informative

      There will be integer overflow after C++0xFF

      Fixed that for you.

  13. old news, this has been known for over a year by Anonymous Coward · · Score: 1

    the standards body has very specific steps that it needs to go through for approval of the standard, with defined notification, voting, etc time windows. mid 2008 it was already clear that it was impossible to follow these rules and get final approval by the end of 2009, even if you assume that nobody has _any_ changes or corrections to anything

    David Lang

  14. Why this is bad by shutdown+-p+now · · Score: 1

    C++ concepts were effectively the same as Haskell typeclasses - an extremely powerful feature that allows for fully and properly typechecked (unlike present-day C++ templates, which are "typechecked" in essentially the same way macros are) abstraction and code reuse in a statically typed language. Removing them significantly reduces the power of the language, and effectively makes C++ a minor evolution of the language (most notable new features are now probably rvalue references and lambdas), and leaves templates as broken as they are today. It's too bad. I'd rather see the standard delayed even more, but done properly.

    1. Re:Why this is bad by ardor · · Score: 1

      Note though that concepts can sort of be emulated in a limited way by using static asserts. Also, variadic templates are introduced, which significantly reduce compile time and size of error messages (because for example boost.bind does not need 10 overloads to support 1 argument, or 2, or 3 ...). So things are not all that bad.

      --
      This sig does not contain any SCO code.
    2. Re:Why this is bad by EvanED · · Score: 1

      Removing them significantly reduces the power of the language...

      I don't think I buy this. I haven't followed the concept discussions for a couple years (and even then the extent of my knowledge was watching a Google tech talk and reading a couple pages of stuff), but I did not see any way that they actually added power to the language.

      I would describe concepts as increasing the usability of templates because you start to get readable error messages, but I don't see anything that can be done with concepts that can't be done without.

    3. Re:Why this is bad by oldhack · · Score: 2, Funny

      C++:
      You can program it like assembly.
      You can program it like FP.

      They should bring Larry Wall into the committee and things will really get cooking. Imagine the awesome possibilities.

      --
      Fuck systemd. Fuck Redhat. Fuck Soylent, too. Wait, scratch the last one.
    4. Re:Why this is bad by shutdown+-p+now · · Score: 2, Informative

      I would describe concepts as increasing the usability of templates because you start to get readable error messages, but I don't see anything that can be done with concepts that can't be done without.

      Concepts let you "overload" templates depending on whether a template parameter conforms to some concept or not. You can do some of that right now with SFINAE, but it's a hack of epic proportions, and it doesn't cover all use cases (e.g. it doesn't let you test for members).

    5. Re:Why this is bad by alphabetsoup · · Score: 1

      Well the new standard has threading support which is also very important. But I am completely in agreement with you - removal of concepts is a major setback for generic programming. Concepts put templates on a solid theoritical ground, which will now be sorely lacking. This is now the *3rd* big feature which was dropped from the standard citing lack of time, other 2 being modules and GC.

      For those interested, this paper compares C++ concepts and templates with Haskell typeclasses: A comparison of c++ concepts and haskell type classes

    6. Re:Why this is bad by EvanED · · Score: 1

      Concepts let you "overload" templates depending on whether a template parameter conforms to some concept or not.

      Ah, okay; that makes sense. I didn't know you could do that (though it also doesn't really surprise me in some sense).

    7. Re:Why this is bad by snaz555 · · Score: 1

      Modules and GC was no big loss since they're not all that useful for system programming; C++ would typically be used to _implement_ things like allocators and garbage collectors. Modules is neat but could often actually restrict code reuse. But concepts would have been extremely useful for code reuse, where templates result in excessively complicated constructs. Templates are commonly avoided for anything other than basic patterns and containers for this reason, which is probably advisable in many circumstances. If you do get it working in one circumstance it's not self-documenting when it will or won't work, i.e. what's expected from the template parameters; the functions/interfaces they need to implement. So a template used to wrap say a PCI ethernet driver might behave erratically or even fail to compile when used to wrap a USB device. Even programmers who understand templates and can effectively debug code factored with them often don't have a solid understanding of the impact on runtime footprint - when the resulting code emitted bloats beyond all sanity, and when it's only a symbol and namespace game. The code itself doesn't express this.

    8. Re:Why this is bad by ioshhdflwuegfh · · Score: 1

      Actually, you can't program it like FP. Sorry.

  15. Well java has standard Thread lib since 1996 by Anonymous Coward · · Score: 0

    Even if they were not preemptive on the MAC in 1996, it would still work if you cared to call Thread.yield() once in a while.

    Hashtable and Enumeration were there in 1996 as well. All newer versions of Java provide backward compatibility for the 1996 version of these classes. Code written in 1996 still runs fine.

    Don't get me wrong, I like assembly, C and bash, I am just stating a fact.

    1. Re:Well java has standard Thread lib since 1996 by ardor · · Score: 1

      So? C++ code from 1996 still runs fine as well. Haskell code from 1996 still runs fine as well. etc..
      What exactly is your point?

      --
      This sig does not contain any SCO code.
    2. Re:Well java has standard Thread lib since 1996 by Anonymous Coward · · Score: 0

      Huh... that it is currently easier to write standard java code that will run on most platforms ?

    3. Re:Well java has standard Thread lib since 1996 by ardor · · Score: 1

      Actually, no. I have seen many problems with legacy Java code that did work properly - in 90% of all cases. And this assumes you don't jump from, say, the SE to the ME.

      --
      This sig does not contain any SCO code.
  16. Re:How about a REAL C++ feature.... by HonIsCool · · Score: 5, Insightful

    With that definition of good programmer, are there in fact any good programmers?

    --
    "Give me six lines of C++ code written by the most competent programmer, and I will find enough in there to hang him."
  17. Re:How about a REAL C++ feature.... by PylonHead · · Score: 5, Insightful

    If you are a good programmer, you can do safe programs in C++ or any other language.

    So it must just be that there are no good programmers. Because I haven't seen any safe web browsers, word processors, or PDF readers.

    --
    # (/.);;
    - : float -> float -> float =
  18. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 2, Informative

    sure when those 'memory safe' languages produce efficient executables that do not require 400MB 'runtimes' to function. The net result from these sandbox environments is a bloated app that requires 5-10x more ram than is needed.

  19. Oh, please. by jcr · · Score: 5, Insightful

    No new C++ features like threads, proper enum classes, or hash tables

    Cause one thing C++ sure doesn't have is enough features, right?

    -jcr

    --
    The only title of honor that a tyrant can grant is "Enemy of the State."
    1. Re:Oh, please. by alexmin · · Score: 1

      Cause one thing C++ sure doesn't have is enough features, right?

      Some of us do not equal C++ to C with classes.

    2. Re:Oh, please. by Metasquares · · Score: 1

      Would be kind of nice if hash_map could finally make it into std, though. Maybe even with a consistent include file across different platforms :)

    3. Re:Oh, please. by Anonymous Coward · · Score: 0

      Personally, I like C++ precisely because it has so many features: I'm not locked in to using a single paradigm for code. For example, templated, standalone algorithms such as those in the STL are much better (imo) than implementing the same function in multiple objects as I might have to in java*. Unfortunately, concepts were the feature that was going to make that really powerful and clean (It can get kinda messy at the moment), and now they've dropped it i've lost a lot of enthusiasm for the new standard.

      Oh well, at least they've left in variadic templates.

      * I know Java has generics, but sometimes for wildly different structures it can lead to reimplementation.

    4. Re:Oh, please. by Anonymous Coward · · Score: 0

      It's called unordered_map and has been in the standard (TR1) for nearly five years.

    5. Re:Oh, please. by Anonymous Coward · · Score: 0

      Some of us do not equal C++ to C with classes.

      And some of us don't go on a template circlejerk fest for 10 weeks when we actually have to get a job done.

    6. Re:Oh, please. by Anonymous Coward · · Score: 0

      This is why I use languages that don't change every few years.

    7. Re:Oh, please. by spiffmastercow · · Score: 1

      This is why I use languages that don't change every few years.

      What language would that be? I can't think of a single major programming language that hasn't been updated at least twice.

    8. Re:Oh, please. by maxwell+demon · · Score: 1

      This is why I use languages that don't change every few years.

      What language would that be? I can't think of a single major programming language that hasn't been updated at least twice.

      INTERCAL?

      --
      The Tao of math: The numbers you can count are not the real numbers.
    9. Re:Oh, please. by dkf · · Score: 1

      I know Java has generics, but sometimes for wildly different structures it can lead to reimplementation.

      Tends not to be needed in Java. Objects are a single-rooted hierarchy there, and you've got interfaces for when things get ugly.

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    10. Re:Oh, please. by RiotingPacifist · · Score: 2, Insightful

      don't like new features, DONT USE THEM, this is one of the few cases where teh new version will not degrade in performance if you ignore the new features!

      --
      IranAir Flight 655 never forget!
    11. Re:Oh, please. by alexmin · · Score: 1

      You do not need to go on template circlejerk fest for 10 weeks every so often. Reading few books once would suffice.

    12. Re:Oh, please. by kamatsu · · Score: 1

      Perl hasn't changed significantly in recent years.

    13. Re:Oh, please. by ioshhdflwuegfh · · Score: 1

      This is why I use languages that don't change every few years.

      What language would that be? I can't think of a single major programming language that hasn't been updated at least twice.

      INTERCAL?

      INTERCAL comes in at least three flavors: INTERCAL-72, C-INTERCAL, CLC-INTERCAL.

    14. Re:Oh, please. by Anonymous Coward · · Score: 0

      No new C++ features like threads, proper enum classes, or hash tables

      Cause one thing C++ sure doesn't have is enough features, right?

      -jcr

      Actually, those items are still in the draft standard. I have no idea where the summarizer got the idea that those features were dropped.

    15. Re:Oh, please. by spiffmastercow · · Score: 1

      Really? I thought it was on revision 5 or something.

    16. Re:Oh, please. by kamatsu · · Score: 1

      Which was released in 94.

    17. Re:Oh, please. by Anonymous Coward · · Score: 1, Insightful

      And then convince everyone else whose code we will ever have to work with not to use them either.

      Fantastic idea!

    18. Re:Oh, please. by deadkennedy · · Score: 1

      Indeed. Why add convolution to an already convoluted language?

  20. Re:How about a REAL C++ feature.... by ardor · · Score: 2, Insightful

    "Can" does not imply "must".

    --
    This sig does not contain any SCO code.
  21. Re:How about a REAL C++ feature.... by AuMatar · · Score: 2, Insightful

    Or better yet- take the crowbar and whack programmers who can't write in C++ until they leave the industry. If you can't understand memory allocation and pointers, you aren't competent to be in this profession.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  22. Re:Well by caramelcarrot · · Score: 1

    Also some of the features they've been aiming for are pretty complex and don't have a proper implementation yet (like Concepts - good an idea as it is) - hence they're trying to standardize from thin air.

  23. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Let me guess, you need an electron microscope and optical tweezers to masturbate, right?

  24. Re:How about a REAL C++ feature.... by ByOhTek · · Score: 1

    So everybody has programmed a web browser, word processor or PDF reader?

    Can you hack a barebones lynx?

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  25. Re:Hmm. by joss · · Score: 1

    God, that's terrible.

    You should be using
    for (auto i=...)

    or for_each(...) and the new [] lambda.. nevermind the really terrible stuff in there, lordy, you dont need * and ->, use * and . or just -> its almost like you're ignorant or out of date or something.

    Goes to show how brilliant C++ is, in a normal language psychotic fuckers can do all sorts of damage, in C++ they can't even compile...

    --
    http://rareformnewmedia.com/
  26. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 3, Funny

    Someone give grandpa his oatmeal.

  27. Old news? by Anonymous Coward · · Score: 0

    I did not RTFA but is there anything new in here? I learned that C++0x was being renamed to C++1x and would not be out untill 2010 a while ago. I think over half a year ago when I was visiting the IRC channels.

    1. Re:Old news? by Arimus · · Score: 1

      I had a vague feeling I recalled C++0x being moved to 2010 and renamed... now reading your post I'm more convinced this is, indeed, old news. Not that /. ever posts old news :roll:.

      --
      --- Users are like bacteria -> Each one causing a thousand tiny crises until the host finally gives up and dies.
  28. C++0x is really good though by MobyDisk · · Score: 4, Informative

    I haven't been following C++0x, but after reading the C++0x FAQ I am very pleased. It really fills a lot of the simple, practical holes in the language.

    I think the success of C# is part of why these things are being considered. For example, C# recently added an advanced form of initializer lists - which is now in C++0x. Another example is the scoping of enums, which has long been a pain. Many coding standards require enums to be ALL_CAPS_WITH_UNDER_SCORES because they don't obey scoping rules: this is fixed. NULL is now replaced with nullptr, which is a minor improvement that looks much like how this was done in C++/CLI. (That's the bastardized C++ for .NET). Namespace cleanups, foreach, ... the list is huge, and it looks like C++ is "borrowing back" from Java and C#.

    Competition is good.

    I know that everything I just listed probably exists in many other languages, but C# and Java are very prominent in enterprise development, and are making huge gains. I will be very very glad to see a real ISO standard gaining ground again.

    1. Re:C++0x is really good though by aztektum · · Score: 1

      Oh, we're suppose to care about ISO again?

      --
      :: aztek ::
      No sig for you!!
    2. Re:C++0x is really good though by StormReaver · · Score: 4, Insightful

      but C# and Java are very prominent in enterprise development, and are making huge gains.

      When discussing languages with coworkers, I've frequently opined that C# is the best thing to have happened to Java in many years. Java had stagnated for a long time without any competitive threat to its domain, which eventually caused me to stop developing in it entirely and focus on C++/Qt.

      A couple years ago, I looked into it again out of curiosity, and saw how far it had come since the introduction of a credible competitor (C#). Swing (it's GUI system, for those who aren't familiar with it) had gotten fast, printing turned from a lame dog into a sports car, and the core language had gained features it lacked until they appeared in C#.

      As much as I despise Microsoft, the competition has been fantastic for Java.

    3. Re:C++0x is really good though by jez9999 · · Score: 2, Insightful

      I'd still lurrrrve to see properties in Java.

    4. Re:C++0x is really good though by Bluesman · · Score: 2, Insightful

      I read the FAQ and I can't shake the feeling that C++0x is a joke that someone's taken way too far.

      It's kind of like how I believe pop icons like Britney Spears are famous because of music industry execs betting they can make anybody famous and then trying to one-up each other when it works.

      Anyway, my favorite part:

      "Try to imagine what the superset of C99, C#, Java, Haskell, Lisp, Python, and Ada would look like."

      I imagine it would look very similar to Common Lisp.

      --
      If moderation could change anything, it would be illegal.
    5. Re:C++0x is really good though by shutdown+-p+now · · Score: 3, Informative

      A couple years ago, I looked into it again out of curiosity, and saw how far it had come since the introduction of a credible competitor (C#). Swing (it's GUI system, for those who aren't familiar with it) had gotten fast, printing turned from a lame dog into a sports car, and the core language had gained features it lacked until they appeared in C#.

      Unfortunately, it's still lagging behind. Java may have gotten autoboxing, enums and varargs because C# had them, but in the meantime C# got lambdas (which are arguably far more important in the big scheme of things, and definitely have a bigger impact on how one writes code). And lately, Java language evolution looks like it has stagnated.

      Of course, there's Scala to consider. If only someone with deep pockets would back it...

    6. Re:C++0x is really good though by binary+paladin · · Score: 1

      And operator overloading.

    7. Re:C++0x is really good though by ioshhdflwuegfh · · Score: 1

      "Try to imagine what the superset of C99, C#, Java, Haskell, Lisp, Python, and Ada would look like."

      I imagine it would look very similar to Common Lisp.

      Indeed.

    8. Re:C++0x is really good though by gbjbaanb · · Score: 1

      I think the success of C# is part of why these things are being considered.

      No, the success of C# is because Microsoft has pretty much said that if you want to do any development for Windows, you'll have to use a .NET language - and C# is the only one that's feasible for most. That it looks like c++ with its {} makes it 'cool' enough for old cpp/java devs to try it.

      Imagine the situation if MS had released VB.NET and, say Pascal.NET and ignored Java.NET (ie C#). I think things would be no different, only the more hard-core devs would be grumblng about having to use them.

      Don't forget that C# started out without lambdas and suchlike, .NET 2.0 was still just as successful for Windows developers.

  29. Re:How about a REAL C++ feature.... by geekgirlandrea · · Score: 2, Insightful

    This. Can we add a special addendum specifying the use of chainsaw instead of a crowbar for fixed-size buffers without checking for overflow?

  30. Thats a mouthful by Demonantis · · Score: 4, Funny

    C++0x is a goofy name no wonder no one wants to work hard on it. How would you like that on your resume. C+=2 is much more consistent with the language and is much easier to read.

    1. Re:Thats a mouthful by infinite9 · · Score: 1

      What would be really cool is a language name that doesn't get mangled by search engines and dice.com because it contains symbols. Just do a google search for C# to see what I mean. :-/

      --
      Disconnect your television. Do your own research. Draw your own conclusions. They're probably lying. Don't be a sheep.
    2. Re:Thats a mouthful by Anonymous Coward · · Score: 1, Funny

      I use C<<=1

    3. Re:Thats a mouthful by Lawand · · Score: 1

      How about C++++

      --
      Your Ad here
    4. Re:Thats a mouthful by Anonymous Coward · · Score: 1, Funny

      I prefer

      c+++=1;

    5. Re:Thats a mouthful by ConceptJunkie · · Score: 1

      You do realize that C++0x was the name for the new standard where x would represent the year it was finalized (of course, now it will be C++1x). The language would still be C++.

      Besides a new name for the language should include some of those wacky new operators. At the rate things are going it could be C++**.

      --
      You are in a maze of twisty little passages, all alike.
  31. Re:How about a REAL C++ feature.... by Rei · · Score: 2, Interesting

    Forget about type safety... just give me the "auto" variable type. :P

    --
    Dear Lord: One of your creatures may be hurt tonight. Please let it be the other creature.
  32. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 0, Flamebait

    sure when those 'memory safe' languages produce efficient executables that do not require 400MB 'runtimes' to function.

    So that means Java and .NET are good to go as neither one of them have 400MB runtimes.

    The net result from these sandbox environments is a bloated app that requires 5-10x more ram than is needed.

    Only if you can't code worth shit.

  33. who cares? by speedtux · · Score: 4, Insightful

    C++ has reached staggering complexity already; I don't think adding another 40 pages of complicated features is going to make the language any better.

    1. Re:who cares? by froggey · · Score: 1

      C++ has reached staggering complexity already; I don't think adding another 4000 pages of complicated features is going to make the language any better.

      Fixed

    2. Re:who cares? by Anonymous Coward · · Score: 0

      I don't know.

      The reason C++ sucks is that it's got a bunch of complex, complicated crap in it that hardly anybody uses or needs, while the things that would actually make the language easier to use are missing.

      Adding (some of) those things now does make the language even more complex, technically speaking, but it's still an advantage - you can continue ignoring the baroque aspects of the language, and getting things done becomes a little easier at least.

  34. Where did you get this information? by LittLe3Lue · · Score: 1

    What does this mean? No new C++ features like threads, proper enum classes, or hash tables.

    As far as I understand, concepts have been "decoupled" from this standard, but not threads, proper enum classes, or hash tables.

  35. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 2, Informative

    someone stop feeding this kiddie count chocula and remind him that his precious sandboxed languages waste cpu cycles...lots of them, and that trend is increasing. The unchecked bloat that is being output by these latest college grads who know nothing but c#, vb, and java are serving no one's interest besides the hardware vendors.

  36. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Anger problem

  37. So in reality we shouldn't use it until 2015 then by SpyPlane · · Score: 5, Insightful

    I've been following C++0x for a long time now, and have been looking forward to it, but now I'm not so sure I'll ever use it. I was looking forward to Concepts more than anything and with that gone, it seems like a extremely minor upgrade. Also, even when the spec does come out, how many years before we can trust that most compilers can use it effectively... two, three? Then after we've been using it for a while, how long before books come out that tell us that we've been using it all wrong and we have to start over (ie: the Exceptional " " and Effective " " books from Sutter and Meyers)?

    Okay, so I can use C++0x well in 10 years, okay I'll probably be so burned out by then I'll be a manager, or I will have convinced someone to let us use D for embedded work and something managed for everything else.

    --
    "We need a fourth law of Robotics: Stop Fingering My Wife"
  38. Re:How about a REAL C++ feature.... by Actually,+I+do+RTFA · · Score: 1

    Lynx and notepad?

    --
    Your ad here. Ask me how!
  39. My bad by wandazulu · · Score: 1

    Sorry, I meant to say that without a final C++ standard, we wouldn't have these features in a standard commercial compiler; I didn't mean to imply that they had been removed from the standard itself.

  40. Re:How about a REAL C++ feature.... by Sam36 · · Score: 0, Informative

    typesafe and memory safe languages are written in c++ you insensitive cod!

  41. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 5, Insightful

    Or better yet- take the crowbar and whack programmers who can't write in C++ until they leave the industry.

    Because C++ is the pinnacle of programming knowledge? *giggle*

    If you can't understand memory allocation and pointers, you aren't competent to be in this profession.

    Just because one can understand memory allocations and pointers doesn't mean one wants to have to deal with them manually in all their programs. There is a reason why there are auto_ptrs in C++ and it's not because those people are "noobs", it's because people want to actually spend their time writing the program rather than having their time eaten up by writing tons of boilerplate memory management code.

  42. Re:How about a REAL C++ feature.... by alvieboy · · Score: 0, Redundant

    I love trolls :)

    typesafe ? Is not C++ type safe ? Where did you read about C++, while listening to some podcast ? Get real man. Read the specs, use it.

    Memory safe ? What is exactly this concept of "memory safe" ? Having a GC that does not have a clue of what the programmer wants to do ? To have a such dumb programmer that expects that memory allocations can be entirely managed by other layers ?

    Get real. You ain't getting anything better than C++ for the time being.

    Oh, sorry. I guess I can run VBscript and Java on this 16kb ROM/2kb RAM controller I have here... or then not.

  43. Mod parent up... by argent · · Score: 3, Funny

    On the whole, I'd rather code in Ratfor.

  44. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1, Interesting

    The unchecked bloat that is being output by these latest college grads who know nothing but c#, vb, and java are serving no one's interest besides the hardware vendors.

    That's funny cause I've never seen a single C# or Java apps that uses as much memory as C++ programs like Firefox (currently using 350 megs of RAM) or OpenOffice.org (current using 250 megs of RAM). On the other hand I have 5 different .NET apps and a Java app running and their combined RAM usage isn't even 200 megs.

  45. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    Memory safe ? What is exactly this concept of "memory safe" ? Having a GC that does not have a clue of what the programmer wants to do ? To have a such dumb programmer that expects that memory allocations can be entirely managed by other layers ?

    That's funny because any good C++ programmer will take advantage of auto_ptrs which effectively do manage memory for you automatically. Or is Bjarne Stroustop only a "dumb programmer" since he advocates their usage?

  46. But will they be useful without concepts? by wowbagger · · Score: 4, Interesting

    "Do you really want to hold back all the other very important features like lambda, rvalue references, variadic templates, type deduction etc. just because of concepts?"

    Unfortunately, without concepts, many of the templates that would make features like those REALLY powerful aren't implementable due to silly things like the compiler insisting upon being able to instantiate member functions that don't make sense for a class and won't be used, just because there isn't a means to tell the compiler "and if this member doesn't make sense, just don't instantiate it, and throw an error IF AND ONLY IF somebody tries to use it." (and yes, I know about SFINAE, but that gets REALLY UGLY to do).

    I've been bit by this, where I ended up having to create two completely separate template classes, one for objects that don't have sub-members and one for objects that do, just because I couldn't tell the compiler "Look, if operator . doesn't exist for this method, then don't worry about it!"

    That said: I will say, I felt that some of the implementation details of concepts felt "forced" to me, in the same way that the streams library feels "forced": they "hacked" (in the bad way) the library in using language semantics that weren't a good fit.

    <sigh/> - I hope the extra time will allow them to put a bit more polish on how you actually express things, and make it feel less "forced"....

    1. Re:But will they be useful without concepts? by Henry+V+.009 · · Score: 2, Insightful

      Stroustrup alludes to it in his article, but I think that the point needs to be emphasized. Concepts need to primarily be about making the experience of using and creating templates easier. It needs to be about fixing the sort of error you mentioned.

      The problem with the current proposal is that it tried to be too many things to too many people. Concept supporters need to regroup and come up with a streamlined concepts proposal that concentrates on making the language easier and simpler.

    2. Re:But will they be useful without concepts? by dkf · · Score: 1

      The problem with the current proposal is that it tried to be too many things to too many people. Concept supporters need to regroup and come up with a streamlined concepts proposal that concentrates on making the language easier and simpler.

      Did I miss a memo or something? I thought the purpose of C++ standards was to make the language more difficult and complex.

      I remember C++ from way back when it really was C-with-classes. Plus some operators. (I think the rot set in with operators.) Back then, one person (who already knew C) really could grok the language in a day or two. Sometime in the intervening years, the vision of simplicity got lost. Nowadays, all the people who might want the language kept understandable are using something else (probably Java, Objective-C or, possibly, C#; all are rejections of C++'s way of doing things despite having a closely-linked heritage).

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    3. Re:But will they be useful without concepts? by Zeinfeld · · Score: 3, Interesting
      I remember C++ from way back when it really was C-with-classes. Plus some operators. (I think the rot set in with operators.) Back then, one person (who already knew C) really could grok the language in a day or two.

      Oh I remember those days. Less good than you imagine. The language might have been simple but the compilers were a complete bitch. Some of them were not even compilers, they were preprocessors.

      They would throw up the type of errors that Visual Studio did when I tried to compile Google Chrome when it came out, 'Type *QWUejw::int(*float) is not equal to *QWUejw::int(*float)'. So instead of taking a week to write your code you could spend three days coding and a month debugging the compiler.

      Thats the real reason everyone jumped onto Java. It was clear that C++ was the product of very confused minds but it was the successor chosen by AT&T labs themselves, it was odds on to win. The only other player in the game was Objective C which was being touted by Steve Jobs, but you had to have a $!0,000 NextStation game cube to run it on. Eifel was maybe interesting but looked highly unlikely to win.

      --
      Looking for an Information Security student project suggestion?
      Try http://dotcrimeManifesto.com/
    4. Re:But will they be useful without concepts? by Anonymous Coward · · Score: 0

      Have you looked at boost::enable_if() and boost::disable_if() ?

    5. Re:But will they be useful without concepts? by moon3 · · Score: 1

      It was clear that C++ was the product of very confused minds

      Hahaha, so explain to me why is C++ used exclusively in production environments like mission critical servers (Google), browsers (Chrome, IE, Firefox), operating systems (Windows), game consoles (X360, PS3, Nintendo Wii), games (Crysis, Counter-Strike, Doom etc.), portable devices like Sony PSP and alike ?

      I do not want to break your matrix but outside (in the real word)
      C++ rules

    6. Re:But will they be useful without concepts? by alexo · · Score: 1

      Unfortunately, without concepts, many of the templates that would make features like those REALLY powerful aren't implementable due to silly things like the compiler insisting upon being able to instantiate member functions that don't make sense for a class and won't be used, just because there isn't a means to tell the compiler "and if this member doesn't make sense, just don't instantiate it, and throw an error IF AND ONLY IF somebody tries to use it." (and yes, I know about SFINAE, but that gets REALLY UGLY to do).

      That is your opinion.
      However, both Bjarne Stroustrup and Herb Sutter disagree.

      Some selective quoting (from the links above):

      Stroustrup: "Concepts" as currently defined are too hard to use and will lead to disuse of "concepts," possibly disuse of templates, and possibly to lack of adoption of C++0x.

      Sutter: Concepts would be great, but for most users, the presence or absence of concepts will make no difference to their experience with C++0x except for quality of error messages.

      Sutter: Concepts are almost entirely about getting better error messages.

      Sutter: We won't have a de-conceptized working draft for the post-meeting mailing, two weeks after the meeting, but should have one soon after that.

      I agree that concepts are useful and important but they are not the end-all be-all you make them to be.

  47. Forty acres and a flying car... by argent · · Score: 5, Insightful

    C++ can't be fixed by adding features.

    C++ can only be fixed by removing features.

    My minivan won't get me to Jamaica, so I need to add wings or pontoons? Or maybe I should buy an airline ticket instead?

    Use the right tool for the job. Sticking another bag on the side of a language that's almost entirely bags isn't going to fix it. If you need a better language than C++, maybe you shouldn't be using C++.

    1. Re:Forty acres and a flying car... by Anonymous Coward · · Score: 0

      Thank you. There are still sane people that understand that no single tool or language will fit all goals. C, C++ and whatever the f they call the next version are C languages, they are not safe, and require good understanding of what is going on. By adding more complexity you only make it more an experts language, that less people understand and even less can debug. I'm all for C+-, keep the classes, make all functions virtual, always, and drop the goddamn implicit copy constructors and templates.

    2. Re:Forty acres and a flying car... by AttillaTheNun · · Score: 1
      Can I get a customizable GUI with this C++0x thingy?

      sorry, I've been spending too much time with Product Managers today.

    3. Re:Forty acres and a flying car... by serviscope_minor · · Score: 1

      C++ can only be fixed by removing features.

      Like what?

      --
      SJW n. One who posts facts.
    4. Re:Forty acres and a flying car... by dkf · · Score: 1

      C++ can only be fixed by removing features.

      Like what?

      User-defined operators. Without them, a crapload of other ill-considered features are unnecessary. (Of course, if you do that then you're a long way towards Java or maybe even Objective-C.)

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    5. Re:Forty acres and a flying car... by Joce640k · · Score: 1

      OK, wise guy, let's have some examples! Put your money where your mouth is!

      What features could you remove from C++ without hurting it? I'll even let you start over and not keep backwards compatibility with old code.

      FWIW: Yes, I can think of one such feature but you seem to have lots ... let's hear 'em!

      --
      No sig today...
    6. Re:Forty acres and a flying car... by jamesswift · · Score: 1

      One of the requirements of the standardisation body is to continue to support the billions of lines of code out there in the real world.
      Given that, removing features is almost impossible to do.

      --
      i wish i could stop
    7. Re:Forty acres and a flying car... by The+Warlock · · Score: 1

      Dunno about the GP poster, but preprocessor macros would be the very first thing on my list.

      --
      I've upped my standards, so up yours.
    8. Re:Forty acres and a flying car... by RiotingPacifist · · Score: 1

      Just because I add a bag doesn't mean you have to use it! If I add wings and pontoons to my car the model without them is still roadworthy, and while i could get an airline ticket instead, perhaps I'd rather use my car becuase going by plane is a PITA(often litterally) and boarding takes file too long! It would also be nice if the majority of my car (all the parts sans wings) was serviceable at one of the many auto-repair shops instead of having to go find an aerorepair company.

      --
      IranAir Flight 655 never forget!
    9. Re:Forty acres and a flying car... by alexmin · · Score: 1

      I have switched to C++ exactly because overloaded operators allowed me to program transformation in parametric domain (think Fourier) in a natural way, like C = B*A. That's instead pascal's C=mult(A,B).
      Now imagine what D=(A*A+(C-F))/L wood look like if written with explicit functions and I'm sure you'll get the point.

    10. Re:Forty acres and a flying car... by Anonymous Coward · · Score: 0

      What features could you remove from C++ without hurting it?

      • virtual base classes
      • "struct" upgraded from C to be endowed with all the same language features as "class"
      • preprocessor macros (inherited from C)
      • nullptr (distinct from integer 0)
    11. Re:Forty acres and a flying car... by ardor · · Score: 1

      Once you start using generic programming, user-defined operators make sense all of a sudden. Also, if you want to define your own little algebra, you really do not want to verbosely write the expressions. a*(b+c) is preferred over multiply(a,add(b,c)) .

      Oh, and moving towards Java would mostly equal devolution. Please choose a better target.

      --
      This sig does not contain any SCO code.
    12. Re:Forty acres and a flying car... by spitzak · · Score: 1

      "struct" is supposed to be the same as class with "public:" right at the start. Unfortunately Microsoft's compiler gets this wrong, not sure why however.

      Instead of adding a new nullptr type, I think the solution is to add a "0" type. The type literally is named "0", as it is only a placeholder in argument lists. The typical example where nullptr is needed would be solved with:


          class C {
              doSomething(X* ptr);
              doSomething(int integer);
              doSomething(0) { doSomething((X*)0); }
          };

          C c;
          c.doSomething(0); // works as though it is a null pointer
          int n = 1-1;
          c.doSomething(n); // calls the integer version

      This would also fix the annoying fact that a method that knows it is taking a null pointer can often do things much more efficiently and differently than one that takes an arbitrary pointer. I see people add extra "clearPtr" type functions because of this, but with this syntax doing setPtr(0) could directly compile to a call to the fast method.

    13. Re:Forty acres and a flying car... by kamatsu · · Score: 1

      You ever used D?

    14. Re:Forty acres and a flying car... by argent · · Score: 1

      Just because I add a bag doesn't mean you have to use it!

      You obviously never had to support someone else's code.

    15. Re:Forty acres and a flying car... by argent · · Score: 1

      So they justify their existence by making the problem worse. I understand, and can even sympathize, but it doesn't change the result.

      C++ is a legacy programming language, like COBOL and Fortran.

    16. Re:Forty acres and a flying car... by Anonymous Coward · · Score: 0

      First you'd have to free the world from (GNU) make and the abomination that's autoconf/configure.

    17. Re:Forty acres and a flying car... by jamesswift · · Score: 1

      I don't think they are making it worse. There is a certain class of changes that are possible but not practical which they can't do but, imho, it is wrong to assume that because of that any changes that are additions are making any problems worse.

      The additions and changes currently in the draft so far will only make my job easier. An that's what I really want. Improvements to a difficult and far from perfect language that is an industry standard.

      I'm not interested in defending the language against other languages here. The next c++ will be better though. That I am sure of.

      But it's not really a legacy language yet. There really is no strong contender to replace it. There are certainly problems for which it is not suitable and nevertheless will be used to solve but that's not a problem of c++. And, again at the risk of repeating myself, the changes in the next standard will make it easier to write better programs in c++.

      --
      i wish i could stop
    18. Re:Forty acres and a flying car... by Suiggy · · Score: 1

      How is Microsoft's compiler wrong about structs? It's not.

    19. Re:Forty acres and a flying car... by spitzak · · Score: 1

      The following does not compile in VC++ but does in GCC:

      class Foo;

      struct Foo {
            int blah;
      };

      This makes it annoying if you decide that a struct should be a class (or vice-versa).

    20. Re:Forty acres and a flying car... by Suiggy · · Score: 1

      Actually, that's non-standard behavior. If you turn on pedantic standards compliant mode in GCC, that won't compile. MSVC++ is correct not to allow that.

    21. Re:Forty acres and a flying car... by spitzak · · Score: 1

      Well then Stroupstrup should fix his book, because he is lying in the first chapter.

      It pretty clearly says that "struct" is the same as "class" except it acts like "public:" is right at the start.

  48. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 0, Troll

    And btw before someone mentions something like Azureus as a counterexample, I've seen Firefox still eat up more RAM than that program if they are running for the same period of time and that's with about 10 or so torrents running in it.

  49. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    That's funny cause I've never seen a single C# or Java apps that uses as much memory as C++ programs like Firefox (currently using 350 megs of RAM) or OpenOffice.org (current using 250 megs of RAM). On the other hand I have 5 different .NET apps and a Java app running and their combined RAM usage isn't even 200 megs.

    First: OO.o is Java.

    Second: The language has little to no bearing on the amount of RAM being used. The amount of data being stored (and how it's stored), however, does. Firefox stores a lot of images and such, which, surprise surprise, eat up RAM.

  50. Ye canno' change the laws of physics... by frank_adrian314159 · · Score: 3, Funny

    They can't release a new standard until they figure out a way to keep the language from collapsing under its own weight, forming a black hole that would destroy the solar system.

    --
    That is all.
    1. Re:Ye canno' change the laws of physics... by MadKeithV · · Score: 1

      Some say this has already happened.

  51. Re:How about a REAL C++ feature.... by Bakkster · · Score: 1

    The unchecked bloat that is being output by these latest college grads who know nothing but c#, vb, and java are serving no one's interest besides the hardware vendors.

    That's funny cause I've never seen a single C# or Java apps that uses as much memory as C++ programs like Firefox (currently using 350 megs of RAM) or OpenOffice.org (current using 250 megs of RAM). On the other hand I have 5 different .NET apps and a Java app running and their combined RAM usage isn't even 200 megs.

    Are any of those .NET apps a web browser or office application? Both require the files they are working on (or at least a sufficiently large portion of them) to reside in local memory. I'm guessing your .NET apps aren't doing anything as data intensive.

    Let's at least compare apples to oranges, here, rather than ham to tomatos.

    --
    Write your representatives! Repeal the 2nd Law of Thermodynamics!
  52. Re:How about a REAL C++ feature.... by wowbagger · · Score: 1

    To have a such dumb programmer that expects that memory allocations can be entirely managed by other layers ?

    That's funny because any good C++ programmer will take advantage of auto_ptrs which effectively do manage memory for you automatically.

    However, the idea is that an auto_ptr "knows" much more about what the programmer is doing than many of the "garbage collection" systems that try to infer it by reading tea leaves^W^Wthe stack frames.

    So you are both right: garbage collection that doesn't get enough data from the programmer sucks, and programmers that rely upon it suck - but auto_ptr and Boost's smart_ptr's don't belong to that category.

  53. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 2, Informative

    First: OO.o is Java.

    Bzzzt wrong. Look at the code, it's 98% or so C++. The only parts that are Java are some database access layers and some stuff for multimedia. Way to show yourself as being an idiot for repeating this oft-repeated and incorrect meme.

    Second: The language has little to no bearing on the amount of RAM being used. The amount of data being stored (and how it's stored), however, does. Firefox stores a lot of images and such, which, surprise surprise, eat up RAM.

    So then you've just effectively nullified your own point since you were blaming the languages on the bloat instead of the crappy programmers.

  54. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    Are any of those .NET apps a web browser or office application? Both require the files they are working on (or at least a sufficiently large portion of them) to reside in local memory. I'm guessing your .NET apps aren't doing anything as data intensive.

    The apps I am using store lots of what they are working in in local memory. One of them is a karaoke subtitle editor which holds the audio in ram, the other is a bittorrent client and one is actually a pretty bloated .NET program that is a frontend for a bunch of encoding tools and it still uses less memory than Firefox does on load up with no tabs opened.

  55. Re:Hmm. by Anonymous Coward · · Score: 0

    Actually, I think it was really ment to torture that vector...

  56. I do by dazedNconfuzed · · Score: 0, Troll

    If you think C++ is staggeringly complex, you're probably not in a position to evaluate whether another 40 pages of complicated features is going to make the language any better.

    --
    Can we get a "-1 Wrong" moderation option?
  57. Re:So in reality we shouldn't use it until 2015 th by TheSunborn · · Score: 1

    Well, most of the things are already supported by compilers, or will be soon. (Se forexample http://gcc.gnu.org/gcc-4.5/cxx0x_status.html for the list of that gcc 4.5 (The newest released gcc version) supports. So it is likely that c++0x will be supported almost fully, within a year of release.
    (Microsoft and intel have also implemented much of the standard).

    The only thing I miss from the gcc is an implementation of "Lambda expressions" and they are working on those. (They have a branch which afair kinda works :}

  58. Re:So in reality we shouldn't use it until 2015 th by samkass · · Score: 1

    Speaking as someone who was writing C++ for 4-5 years *before* ANSI came up with the original spec, that's not really the part I'm worried about. Judging by past experience, everyone except Microsoft will probably come up with a "good enough" compiler relatively quickly, and there will be a series of #defines that will allow one to simulate compliance on Microsoft compilers.

    --
    E pluribus unum
  59. Re:Who cares now? by Tanktalus · · Score: 5, Funny

    There are two basic problems with your code. First, there are unbalanced parenthesis. Second, this is a thread about C++. Not Perl. Next time, be more careful. Thanks.

  60. Template la-la land. by Animats · · Score: 5, Insightful

    Some years ago, the C++ committee went off into template la-la land. Most of the work there focuses on template features that will be used by few, and used correctly by fewer.

    Templates are useful, but "generic programming", doing arbitrary computation at compile time with templates, was a terrible idea. Templates can be abused as a recursive term-rewriting system, and through some clever and obscure tricks, recursive computations can be run at compile time. As a programming language, this trick is awful; awful from a syntax point of view, awful from an understandability point of view, and awful from a debugging point of view. If you need to do work at compile time, there have been much better approaches. LISP "macros" were standard LISP, not a second language. And even they created such a mess that Scheme had to be invented to clean out the language.

    Orignally, templates were conceived as a saner way to do what C programmers did with macros, providing a way to have some type independence at compile time. But the template crowd got out of control.

    The obsession with templates has led to a neglect of things C++ really needed, like better memory safety (C++ still has buffer overflows, and most of the security holes today stem from this), and better approaches to concurrency (the compiler has no idea what locks what, and it needs to know). Anything that wasn't template-related tended to be ignored by the committee.

    The result of this failure has been C++ spinoffs - Java, C#, etc. Even Objective C has made a comeback in the Apple world. C++ has never even been able to displace C, twenty years on.

    I've written a lot of C++, and I'm disgusted with this mess.

    1. Re:Template la-la land. by Rockoon · · Score: 1

      Here here. Mod this man up!

      Some-subset-of-templates was sorely needed, but the form that came out is and will always be completely horrible. Its a way-too-generic solution to some specific problems. When you look at languages like C# which solved most of those specific problems cleanly and simply, one just has to shake their head at what the C++ team was thinking.

      --
      "His name was James Damore."
    2. Re:Template la-la land. by rkit · · Score: 1

      Maybe so, but stuff like boost multi-index containers is really great.

      --
      sig intentionally left blank
    3. Re:Template la-la land. by Xtravar · · Score: 1

      This is precisely why I prefer to use 100% C code when I have to write native binaries. C++ is a convoluted mess.

      It seems like they were very haphazard at first, with OO being new and compiler optimization being slim. We have to kill off the old C++ and come up with a new natively compiled language. Or not. This web thing seems to be doing pretty well, as do Java and C#.

      Vala has some promise, but I'm not entirely convinced yet.

      --
      Buckle your ROFL belt, we're in for some LOLs.
    4. Re:Template la-la land. by Anonymous Coward · · Score: 0

      In your case, I'd say the reason is that C is MUCH MUCH easier to learn than C++. Your post, nor the parent post contain any argument against using C++ in favor of C.

    5. Re:Template la-la land. by alphabetsoup · · Score: 3, Interesting

      Templates are what makes programming in C++ a joy compared to other languages. And concepts would have completed the generic programming framework in C++. Concepts are like typechecking for templates. With templates + concepts, programming in C++ would have been almost as elegant as Haskell, except 10 times faster.

      Without generic programming you not have typesafe containers, no smart pointers, no typesafe variadic functions. In fact templates have almost replaced OOP in C++ - libraries like ATL use templates for compile time polymorphism, instead of runtime polymorphism using virtual functions.

      I suggest you read Alexandrescu's Modern C++ Desing before commenting on generic programming. Modern C++ is not the C++ of 1990s.

    6. Re:Template la-la land. by Anonymous Coward · · Score: 0

      "things C++ really needed, like better memory safety (C++ still has buffer overflows, and most of the security holes today stem from this), and better approaches to concurrency (the compiler has no idea what locks what, and it needs to know)."
      We (the HPC community) have Fortran for that.

      No, that's not a joke.

    7. Re:Template la-la land. by Xtravar · · Score: 5, Insightful

      You mean C++ being a clusterfuck of ugly syntax isn't a reason for using C?

      I learned C++ first. I thought the 'limitations' of C were silly and archaic. Then I grew up and realized that having straight-forward, easy-to-maintain code is much more important. /feeding the troll

      --
      Buckle your ROFL belt, we're in for some LOLs.
    8. Re:Template la-la land. by Anonymous Coward · · Score: 0

      Since Haskell is already only cca. three times slower than C++, why don'Å C++ programmers start using "templates + concepts" to make C++ three times faster than it is now (i.e. ten times faster than Haskell is now)? *ducks*

    9. Re:Template la-la land. by maxwell+demon · · Score: 2, Informative

      Templates are useful, but "generic programming", doing arbitrary computation at compile time with templates, was a terrible idea.

      Doing arbitrary computation at compile time with templates is called "template metaprogramming." The "generic programming" is what the STL does: Provide a single templated implementation for an algorithm working out of the box on vastly different data structures.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    10. Re:Template la-la land. by shutdown+-p+now · · Score: 1

      Templates are useful, but "generic programming", doing arbitrary computation at compile time with templates, was a terrible idea.

      You confuse "generic programming" with "template metaprogramming". The first is a broad name for various techniques of advanced code reuse, and is beneficial. The latter is what you actually describe. C++0x concepts were supposed to improve the former, not the latter (though obviously they would still be beneficial for it).

    11. Re:Template la-la land. by maxwell+demon · · Score: 1

      C++ does have better memory safety, unless you insist in using the old C stuff still included, instead of using the superior C++ alternatives. For example, if you have a single malloc or array new in your program, there are high chances that you've made a design error.

      And of course you can easily have buffer overflows in Fortran as well.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    12. Re:Template la-la land. by maxwell+demon · · Score: 1

      You mean C++ being a clusterfuck of ugly syntax isn't a reason for using C?

      Given that C++ inherited that ugly syntax from C: no, it isn't.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    13. Re:Template la-la land. by dkf · · Score: 1

      Templates are what makes programming in C++ a joy compared to other languages. And concepts would have completed the generic programming framework in C++. Concepts are like typechecking for templates. With templates + concepts, programming in C++ would have been almost as elegant as Haskell, except 10 times faster.

      You mean that templates don't already enforce sane subtype constraints? In the immortal words "what were you guys thinking?"

      --
      "Little does he know, but there is no 'I' in 'Idiot'!"
    14. Re:Template la-la land. by jamesswift · · Score: 1

      I wouldn't exactly say 'a joy' but yes, type safe generic programming is pretty powerful in c++ and not what the GP seems to describe it as.
      Those tricks of using templates to do compile time computation are not examples of what templates are really used for.

      However, only a mad man would defend c++ syntax.
      Get past that and it's not so bad at all.

      --
      i wish i could stop
    15. Re:Template la-la land. by istartedi · · Score: 4, Insightful

      Ditto here. When I got my first "modern" PC, a Pentium 75 I wanted to learn how to program on it and got Microsoft's compiler. The books that came with it actually did a pretty good job of teaching C++. I wrote a fairly large program in C++--A program for editing VRML. I had to link in libraries for JPEG and PNG. When I saw how elegant and cross-platform these libraries were, I realized what a mess C++ was. I also realized how Object-Oriented Programming tended to paint people into a corner. I ended up having to instantiate Foo in order to access function Bar, when I should have simply written all the functions as stand-alone functions, using only the structures they needed.

      By the time I was done messing around with VRML (which does in fact model well as a class hierarchy) I had come to the conclusion that maybe 10% of the problems out there require an OOP language.

      Now I tend to think it's an even lower number, and I would just as soon work around it when necessary by rolling my own objects in C (function pointers, yay!).

      I wrote more and more C. I haven't written C++ for myself, or professionally, in 10 years.

      I know this is controversial; but I think OOP has polluted and hopelessly corrupted the minds of an entire generation of programmers. I find myself taking an interest in FORTH lately, and to a lesser extent, Lisp.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    16. Re:Template la-la land. by Anonymous Coward · · Score: 0

      auto_ptr is not a replacement for new and delete. Vectors are not a replacement for arrays. If you don't understand that, you don't understand C++. You don't want to use vectors if the size of your collection isn't going to change, and you don't want to use auto_ptr for anything that's going inside an stl container (it doesn't work) or as a class member (that's what destructors are for).

    17. Re:Template la-la land. by thechao · · Score: 2, Insightful

      Okay, IAAEOC++0x (I am an expert on C++0x), one of my group's PIs is Bjarne Stroustrup and my committee consists of members from both the Indiana & Texas concepts proposal; the extended group is responsible for lambdas, concepts, variadics, for-each constructs, etc. Credentials aside, "templates" != "generic programming". Concepts were designed to provide a predicative type-system for templates [think of this as a kind-system] which allows us to get rid of most of the template metaprogramming hacks (SFINAE enable-if/disable-if, type computations, etc.). Variadics (also for templates) get rid of list-like type-computations. At the cost of adding a relatively light-weight description of an interface (think of a concept as a compile-time only interface) we can get rid of almost all of the hairy bits of template coding.

      The reason why concepts was rejected is due to some of the uglier corner cases stemming from a requirement for soundness in the type-system using concepts. As we are slowly approximating second-order types with C++ (all typeful languages end up doing this to increase expressivity) there are bound to be some hiccoughs. What happened at ISO (as far as I know) came from an argument on the reflector which revolved around the default of whether a concept was auto(matically) satisfied by a type or if it must be explicit [a fairly arcane argument], in addition to the handling of associated and intermediate generated types. It is not clear if a simpler solution can be constructed for a decidable type-system.

    18. Re:Template la-la land. by ozzee · · Score: 1
      I have a very different opinion. I think templates in C++ are very powerful and useful.

      I don't write template code every day, but that's kind of the point. Templates can eliminate most ugly repetitive code and allow you to model it closer to the abstraction you're most comfortable with.

      The project I'm working on at the moment is Java and the generics in Java are so far away from templates and so it limits the usefulness of it dramatically.

      Yes, you need to get into templates to understand them, they are a new programming language, not unlike Prolog in some ways.

    19. Re:Template la-la land. by Anonymous Coward · · Score: 0

      > be used by few, and used correctly by fewer.

      So it's like C#, Java and all those other languages that are actually being used?

      Please just fire the dipshits who can't be bothered to learn their language(s) well enough. Same goes for english-speaking. If you can't even be bothered to spell or punctuate somewhat correctly, just get lost.

    20. Re:Template la-la land. by maxwell+demon · · Score: 1

      First, I explicitly qualified "array new" - non-array new is of course essential. And yes, you cannot put auto_ptr in a container (you can put shared_ptr in a container, but that's not always desirable). So insofar as you are advocating that simple new/delete has its place in well-designed programs, I totally agree.

      OTOH, std::vector is a replacement for newed arrays. There's no law that you have to change your collection's size just because you can. And apart from construction, the performance of vector and newed array should be exactly the same on any self-respecting implementation. And the performance differences on construction rarely matter.

      Now, there are scenarios where that difference matters, and there are even scenarios where malloc is the right tool (interfacing with libraries written in C). That's why I wrote "high chances that you've made a design error", not "a sure sign that you've made a design error).

      --
      The Tao of math: The numbers you can count are not the real numbers.
    21. Re:Template la-la land. by js_sebastian · · Score: 1

      Some years ago, the C++ committee went off into template la-la land. Most of the work there focuses on template features that will be used by few, and used correctly by fewer.

      As a user of the STL and various boost libraries, I use a lot of fancy template magic WITHOUT having to know about it. The only problem with that is that I get complicated error messages from inside these libraries, because the compiler does not know that the mistake is really in my code (for, say, passing a parameter to some template function that is const and shouldn't be).

      The goal of concepts is to be a feature that (a) you do not have to know about unless you write your own templated classes, and (b) allows the compiler to give meaningful error messages when you misuse someone else's template. In the above example, it would just say "passing parameter 2 to this function discards the const qualifier" or some such thing. I do not see any la-la-la here. It's a pity it won't make it into this standard.

    22. Re:Template la-la land. by Anonymous Coward · · Score: 0

      Then I grew up and realized that having straight-forward, easy-to-maintain code is much more important.

      And that's why I switched to Perl! :)

      (Actually, I love Perl, so this comment is both intended as a serious statement AND some self-deprecting humor. :))

    23. Re:Template la-la land. by MadKeithV · · Score: 1

      It might be controversial but you are not alone. Languages like Java and C# and to a lesser extent C++ have made a whole generation of (lousy) programmers think EVERYTHING must be OO.
      And then they go ahead and make every class a singleton or chuck it full of static methods.
      Of course the good programmers get past this quickly, but it's still an uphill struggle to convince them that OO is not the answer to life, the universe, and everything.

    24. Re:Template la-la land. by Anonymous Coward · · Score: 0

      I self-whooshed by the moderation on the parent.

    25. Re:Template la-la land. by ltcmelo · · Score: 1

      While I agree with you on concurrency and partially on memory safety, there's a point I'd like to make. Yes, compile-time computations is accomplished by templates. This is widely known as *template meta-programming*. However, *generic programming* is more like a programming paradigm. A way of thinking and building algorithms and concepts regardless of how the data structures they depend on is represented. Generic programming does use some template meta-programming techniques. But in most cases it's done for type identification and not for the kind of computations you mention (remember the classical compile-time factorial). Although there's an overlap between these two areas, take the STL as generic programming in its essence and the Boost MPL on the other side. Also, I'm not sure that templates were originally conceived as a replacement for macros. I think that even from the beginning there was more to it.

    26. Re:Template la-la land. by Anonymous Coward · · Score: 0

      If you use state machines to model your systems, the OOP naturally fits in. If you find top-down functional decomposition and data and control flow charts as easier tools to model your systems, perhaps structured programming is the way to go. Some like and are more productive using GUIs, some using TUIs. Programming paradigms are user interfaces for defining data and control for a computer.

  61. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    azureus is a good example, but not just because of its ram footprint.. it's still dogass slow. in comparison, look at rtorrent or utorrent. nice, small, fast, efficient code. both in c++

  62. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    So you are both right: garbage collection that doesn't get enough data from the programmer sucks, and programmers that rely upon it suck - but auto_ptr and Boost's smart_ptr's don't belong to that category.

    Yes, relying on a garbage collector that you and the GP describe which is about 10-15 years out of date would make you a sucky programmer. Fortunately for us, though, GCs have gotten much better since then.

  63. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    So your 5 unspecified .NET apps and an unspecified Java app combined don't use as much RAM as a web browser that is designed to quickly run through all tabs and documents that have been loaded since it started? Who gives a shit.

  64. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    Yes, Azureus is a crappily written program. The point though is that I've seen it running with 10+ torrents for the same amount of time as Firefox and it still uses less memory. The point was that this whole notion that only Java and .NET programs are bloated use up tons of RAM is a stupid and incorrect meme.

  65. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 0, Troll

    Yes, but since every Java and .NET app are supposed to be super bloated wouldn't they by that very virtue have bigger executables and use more RAM than any C or C++ program? Or maybe my point was that such oft-repeated hyperbole is moronic.

  66. Re:How about a REAL C++ feature.... by PitaBred · · Score: 3, Interesting

    And there are times when you want the memory management code for performance, and you can't get to it. I've seen such horrible Java programs from new programmers because they are never taught ANYTHING about memory management. You can't forget about memory in ANY language that you use. I highly value C/C++ as an initial learning language because it forces you to recognize that resources need to be allocated in order to use them. Java and other languages make implicit allocation easy, but it hides that from the programmer, which allows people to shit all over memory because they don't have a clue about removing objects when done, or even just removing all references to them. They just don't know.

  67. Re:How about a REAL C++ feature.... by Tubal-Cain · · Score: 1

    You assume the good ones have worked on any of those.

  68. Re:So in reality we shouldn't use it until 2015 th by shutdown+-p+now · · Score: 4, Interesting

    I've been following C++0x for a long time now, and have been looking forward to it, but now I'm not so sure I'll ever use it. I was looking forward to Concepts more than anything and with that gone, it seems like a extremely minor upgrade.

    I would disagree on this part. I'm already using some C++0x features actively in production code, and I can say that they are well worth it. Lambdas are extremely handy as they finally let you use STL (and Boost) algorithms properly without lots of unneeded hand-waving. This may sound a minor thing, but remember how things have changed in C# world when anonymous delegates were introduced in C# 2.0, and their syntax simplified in 3.0? All of a sudden, everyone shifted to functional ("LINQ") techniques of writing code, abandoning hand-coded loops. The same thing happens here.

    The second big part is rvalue references. They really do give major performance benefits for STL containers, especially of user-defined types (as smart implementations of C++03 already optimize their containers for standard types to avoid copy by using swap instead - but they can only legally do it for types they control...).

    One other thing. C++0x may take a while to be released, but you'll see quite a few of its features in production-quality compilers before the spec is finalized. I've already pointed out that some are in VC++2010. There's even more in newer g++ versions (IIRC, they implement all that stuff, and also variadic templates). I've also seen mention of rvalue references and lambdas in the feature list of the most recent C++Builder release. All in all, this means that you'll have them at your disposal within a year or so one way or another.

  69. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 1, Informative

    for a given task, they tend to, assuming both projects had competent programmers. It's not just about storage, it's also about execution performance. .NET comes closest but still does not compare with well written native code. The difference IS noticable. There is a reason microsoft still maintains their C/C++ compiler. There is a reason OS kernels aren't written in java. There are things that cannot be done in sandboxed languages, exercises in geek masturbation notwithstanding. Sure one CAN write an office suite in java or CSS/javascript, but the result is a slow painful mess for the user.

  70. Re:How about a REAL C++ feature.... by PylonHead · · Score: 2, Interesting
    --
    # (/.);;
    - : float -> float -> float =
  71. Re:How about a REAL C++ feature.... by CastrTroy · · Score: 3, Informative

    Azureus isn't a browser though. It downloads torrents. They do completely different things. A browser actually has to render images, animations, and even videos. It has to parse large amounts of HTML, CSS, Javascript, and make sense of all that so that it can display it on the screen. Torrent applications are basically glorified FTP clients. They don't have to display anything on the screen at all. They just have to manage a bunch of internet connections and save some data to the disk. It's like me saying that Notepad uses less memory than Azureus, therefore C++ is better. Show me a browser with a similar feature set to Firefox written in Java, and then we can talk.

    --

    Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
  72. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Or better yet- take the crowbar and whack programmers who can't write in C++ until they leave the industry. If you can't understand memory allocation and pointers, you aren't competent to be in this profession.

    Post me one of your taskbuilder descriptor files before continuing. If you aren't competent to understand memory allocation and management at compile time, you aren't competent to be in this profession. Run time memory management is trivial.

    Don't know TKB? N00b.

  73. Re:How about a REAL C++ feature.... by Joce640k · · Score: 5, Insightful

    The problem is the amount of C programmers/thinkers who think they're writing C++ just because they type "class". It doesn't work that way, C++ is a totally different language.

     

    eg. If you're Doing It Right then it's impossible to get a "buffer overflow" in C++. Most of the exploits you see are down to buffer overflows so I leave you to draw your own conclusions about the programmers.

     

    Problems with C++ that will catch C programmers:

    • Lack of a standardized smart pointer. That would have made a huge difference.
    • Arrays. Arrays are evil. C++ should have skipped arrays and gone directly to std::vector.
    --
    No sig today...
  74. Re:How about a REAL C++ feature.... by PylonHead · · Score: 2, Interesting

    So, if I'm understanding your argument, there are good programmers, but none of them are actually trying to program securely.

    They could stop writing vulnerabilities if they wanted to...

    --
    # (/.);;
    - : float -> float -> float =
  75. Re:How about a REAL C++ feature.... by johnlcallaway · · Score: 3, Informative

    Gotta have the "auto" variable because expecting all programmers to know how to type efficiently or to understand what data types are being used isn't fair to those that haven't gained those skills yet.

    --
    I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
  76. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Thats because it doesn't count the shared libraries that are loaded in the background, also known as the WHOLE .NET PLATFORM thats loaded into your ram to run anything in c# or other CLR language.

  77. Re:How about a REAL C++ feature.... by Hurricane78 · · Score: 1

    That language would be called Haskell. And the type safety crowbar built into GHC really freaking hurts (your brain)! ;)

    Haskell -- The most beautiful and painful language to learn at the same time.

    Am I a masochist? If so then: Moar monads, in teh gonads! ^^

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
  78. Re:How about a REAL C++ feature.... by dgatwood · · Score: 1

    If you are a good programmer, you can do safe programs in C++ or any other language.

    So it must just be that there are no good programmers.

    There are plenty of good programmers. Like the guy who wrote Hello, World. Completely safe.

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.

  79. Re:How about a REAL C++ feature.... by Joce640k · · Score: 4, Interesting

    That's funny cause I've never seen a single C# or Java app.

     

    Where are they? If C# and Java are so great, where are the apps? It's been, what, twelve years since it was announced that they'd take over the world and make C and C++ obsolete but I've yet to see a C# or Java program that wasn't some simple sort of utility or the GUI layer over a C++ app (eg Norton products).

     

    What I have noticed is that all those "GUI layer over a C++ app" programs are enormous. 200Mb for a disk backup program (both Norton Ghost and Acronis TrueImage went from 20Mb to 300Mb during their transition-from-C phase and neither of them seems any better off for it.

     

    Firefox memory usage is a mystery to me. I can't conceive of how it uses so much memory just to show a few pages of text with embedded images. The other browsers aren't really far behind though so maybe I'm missing something.

    --
    No sig today...
  80. Re:How about a REAL C++ feature.... by Hurricane78 · · Score: 1

    Wanna know what we real professionals do, who don't have the time or the stupidity to re-invent the wheel of memory management every time they write a program?

    We solve that problem once, make a library out of it or abstract it out, and are done with it. We call it advanced garbage collection.

    It's like a calculator: You could do all those calculations in your head, or with a mechanic tool, in less steps than the calculator needs. But why? The problem was solved decades ago.

    In my eyes, between C with assembler, Haskell, and Python & co, there is no space left to be filled by C++. It's a dirty ugly language, that wants the features of Haskell with the low-level of C, but fails to be better than any of those two.

    --
    Any sufficiently advanced intelligence is indistinguishable from stupidity.
  81. Re:How about a REAL C++ feature.... by DuckDodgers · · Score: 3, Interesting

    Care to hazard a guess as to how complex those 5 .NET and Java applications are compared to a web-browser or Office Suite?

    To make the comparison fair, you should be measuring Firefox against a more or less even-featured competing web browser written entirely in .NET or Java, running the same websites. Likewise for comparing against OpenOffice. I don't think either item exists yet.

    I'm not saying Firefox and OpenOffice are especially lean applications. They definitely do seem like resource hogs. But the most logical explanation for the lack of proprietary or open source Java and .NET web browsers and office suites to compete with them is that they flat out can't do it.

  82. Re:How about a REAL C++ feature.... by Rei · · Score: 1

    Wait, so having your code take up a bunch of wasted space and having to make you change a lot of code when structures or functions change is somehow a good thing in terms of development time and maintenance?

    --
    Dear Lord: One of your creatures may be hurt tonight. Please let it be the other creature.
  83. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    "don't want to deal with them"? it's perfectly fine to optimize development time, but this trend of offloading excess work onto users platform is unacceptable. it directly opposes the whole point of having computers in the first place. a few years ago, some contractor tried to offload this java based mainframe screen scraper app. When we told him it was too slow for our desktops, he said "I'm sorry, but our app requires robust clients." needless to say, he did not get the sale. Apparently, professors are telling kids not to worry about performance because hardware always gets faster while ignoring the fact that it's all about performance/given hardware.

  84. Re:How about a REAL C++ feature.... by Tarlus · · Score: 3, Interesting

    Just because one can understand memory allocations and pointers doesn't mean one wants to have to deal with them manually in all their programs.

    I fully agree with this. I've learned all about the use and necessity of pointers and allocation, and I've done my time with the debugging and memory leaks because I didn't do it right. Lots of great lessons from that. And I can really appreciate languages that handle that for me so I don't have to fuck with it. It saves me so much time and frustration.

    Although it irks me that colleges start people off with these languages now. Most students I teach were brought up on a strict diet of Java and so to them, variable declaration is just a formality and pointers (or references, as the Java people insist) are just part of the magic that happens behind that friendly, colorful compiler.

    These are the types I fear for in the industry.

    --
    /* No Comment */
  85. Templates can be abused by Joce640k · · Score: 1

    The key word is "can". Nobody's forcing you to abuse them.

     

    I agree with the guy above though: C++ needs templates because it needs things like std::vector, std::string and smart pointers. The problems appear when "creative" people get hold of them.

    --
    No sig today...
  86. How is this new? by Tired+and+Emotional · · Score: 1
    Its well known that the x is base 16. So far I don't know of any standards that required base > 16.

    The language that eventually became Fortran 90 was known as Fortran 8x during its development period.

    Given that its now the latter half of 2009, the chances of C++ 0x actually having x==9 have been vanishingly small for quite a long time already.

    --
    Squirrel!
  87. Then use a framework by Stele · · Score: 1

    Just because one can understand memory allocations and pointers doesn't mean one wants to have to deal with them manually in all their programs.

    Then use a framework, like Qt, that deals with all of that for you.

    I write graphics software, and C++ allows me to write very efficient, flexible, and maintainable code that runs on a variety of architectures. Just because you don't need to mess around with pointers, that doesn't mean everyone doesn't need to.

    1. Re:Then use a framework by Freetardo+Jones · · Score: 1

      Then use a framework, like Qt, that deals with all of that for you.

      Or I can just use a built-in language feature like auto_ptr which takes away most of what you used to have to do manually.

      Just because you don't need to mess around with pointers, that doesn't mean everyone doesn't need to.

      Great. I never made any such claim. Are you arguing against someone else with that sentence?

  88. History repeating itself by r45d15 · · Score: 0

    We're already going through the same scenario as OpenGL 3.0 - lots of years spent on essentially a bare minimum of changes which in the end pissed off and disappointed practically everyone. Another coincidence, C++ is the primary language of OpenGL.

  89. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Compare what you can compare, for example tomboy memory and CPU ressources to its C++ clone, gnote, or point me to a browser as feature-rich as firefox written in Java.

  90. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 3, Interesting

    If C++ wasn't based on C, it might have been a decent language...
    OOP, metaprogramming, RAII, exceptions are all decent concepts. Too bad it also inherited C's "arrays are just pointers" idiom, and extended C's already stupid grammar to the point of grotesqueness. And it's not going in the right direction nowadays either. The syntax they chose for lambdas in C++0x is awful.

  91. Re:Well by DuckDodgers · · Score: 1

    It would be different if the standardization committee was working on some tiny new language that 98% of the Slashdot population - let alone the world at large - had never encountered. This is C++, still one of the most commonly used programming languages in the world.

    The committee would be stupid to move too quickly. Their biggest job right now is simply not to break the stuff that already works. I'm not saying C++ is already mostly great, just that changing it too much will make moving from older versions to C++0x harder.

  92. Re:How about a REAL C++ feature.... by Joce640k · · Score: 1

    Have garbage collectors got to the point where they can avoid scanning the entire heap when the going gets rough? Scanning the entire heap when you're low on RAM and paging to disk isn't too smart - performance will drop by six or seven orders of magnitude.

     

    Last time I checked, the 200,000 lines of C++ that I'm working on had exactly 19 "delete" statements in it, everything else is automatic. The is hardly "manual memory management".

    --
    No sig today...
  93. Any topic by BigJClark · · Score: 3, Insightful


    Any topic that involves geeks and C++ is just asking for flame wars, I'll submit my name to the mix.

    Although I've been coding in c++ for more years than half of you have been alive, and am rather biased, I feel good programmers write good code independent of the language they use.

    --

    Hi, I Boris. Hear fix bear, yes?
    1. Re:Any topic by jjohnson · · Score: 1

      My web programming experience agrees with this, especially as I move back and forth between PHP, Python, Java, and C# (and their various frameworks). The same patterns occur, the same solutions are the best, and the same general attitude towards creating robust, maintainable code is rewarded in each.

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
    2. Re:Any topic by Anonymous Coward · · Score: 0

      Have you tried Ruby for web dev?

    3. Re:Any topic by jjohnson · · Score: 1

      No, because (despite what I said above) there are still differences between the various platforms, and it's hard to keep them all straight, so adding another combo to the mix doesn't seem justified by some gains in doing things the Ruby Way. And doing Python/Django already , I don't expect to see a huge leap in productivity with Ruby on Rails, since both cover approximately the same niche.

      --
      Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
  94. Re:How about a REAL C++ feature.... by Oswald · · Score: 1

    How can it be safe when it's not even correct?

  95. Re:How about a REAL C++ feature.... by geniusj · · Score: 4, Informative

    Any garbage collected language requires more memory to operate than the program actually needs.. Otherwise you'd be garbage collecting 24/7. So yes, if you want to minimize GC cycles/pauses, your memory usage can be vastly higher than what the program would actually require in a traditional language. That's probably the big reason, for example, that the iPhone doesn't support GC in its Objective-C implementation.

  96. Re:How about a REAL C++ feature.... by t3chn0n3rd · · Score: 0

    C++ new features , Do they already have book out detailing the new features? Looks like I will have to brush up on my C++

  97. Re:How about a REAL C++ feature.... by geniusj · · Score: 1

    Firefox contains a GC'd language: Javascript. And why don't you compare it to a comparable web browser written in Java? Oh right, there aren't any. Apples and oranges.

  98. Re:How about a REAL C++ feature.... by Joce640k · · Score: 2, Informative

    Um, yes. And they do.

     

    Take a look at something like Acronis TrueImage (or any Norton program) before/after their transition from C++ to C++-with-C#-user-interface.

    Installer before: 29Mb

    Installer after: 290Mb

    Memory usage: Completely unusable on a 512Mb machine

     

    nb. I use these as an example because they're the only commercial apps I can think of that use .Net.

    --
    No sig today...
  99. Re:How about a REAL C++ feature.... by squoozer · · Score: 5, Interesting

    Back in the day they used to have little children crawling around under cotton stipping machines. The children were needed to pick up fluff and other debris that would cause the machine to break the thread it was working on. Some children would get crushed in the machine because they weren't fast enough to get out of the way etc.

    C++ is a bit like that machine. It works fine if you have the luxury of being able to pick only the fastest most able children but there comes a time when you need to grow your business beyond the limits of what the best can achieve. At that point you need to either accept that some of the less able children will get crushed (bugs in the code) or you need to make the machine safer. It's often cheaper and simpler to make the machine safer and hopefully those most able children will then be able to perform more complex and hopefully profitable work.

    To paraphrase... everytime you argue for a language without safety features god kills a child.

    --
    I used to have a better sig but it broke.
  100. Re:How about a REAL C++ feature.... by NoOneInParticular · · Score: 1

    In some cases it makes sense to exactly know when a piece of memory is freed. In most cases, a general GC suffices. C++ allows the 'some', Java/C# does only the 'most'. Do you have any idea how much time your program spents in GC cycles? The Java programmers I know, don't have a clue, as it usually doesn't show up in their profilers...

  101. Re:Hmm. by ElKry · · Score: 1

    [...] its almost like you're ignorant or out of date or something.

    Goes to show how brilliant C++ is, in a normal language psychotic fuckers can do all sorts of damage, in C++ they can't even compile...

    Errrrr....

    (*i) would refer to the object that the iterator is pointing at... -> is needed if that object is a pointer ( which seems to be, given that syntax and the delete (*i) )

    So indeed, his code seem to be valid at first glance, and would compile if the std::vector is a container with pointers on it. Maybe C++ is more suited for psychotic fuckers than for you...

  102. Re:How about a REAL C++ feature.... by NoOneInParticular · · Score: 2, Insightful

    How many Java browsers are out there? None? Case in point.

  103. Re:How about a REAL C++ feature.... by NoOneInParticular · · Score: 1

    So, these apps are neither browsers nor office suites? Come back when you've got something of comparable complexity. I can program a 'frontend for a bunch of encoding tools' in probably 60K of memory (if I lazily load the tools). Doesn't prove a thing.

  104. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    "don't want to deal with them"?

    In all programs, yes sometimes you don't want to deal with them when you can use a language feature to simplify things. Dealing with new/deletes, etc is both a tedious task and can be very error prone as one can see by the number of C++ programs that have memory leak issues. Now this isn't to say that there aren't cases where you have to do it because of critical performance reasons.

    it's perfectly fine to optimize development time, but this trend of offloading excess work onto users platform is unacceptable.

    It's unacceptable to use a built-in language feature, such as auto_ptr, to help to reduce the amount of memory leaks? Huh?
     
    The rest of your post has no relevance at all to what I was talking about. I wasn't proclaiming that one shouldn't ever manage their memory manually or that you shouldn't care about performance or the quality of your code because hardware will get faster to make up for it. You seem to be ranting at someone else or else your turning my post into some sort of strawman.

  105. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    I've seen such horrible Java programs from new programmers because they are never taught ANYTHING about memory management.

    Well but that can be said of programs written in any language. It's not a language or frameworks fault if you can't write good code. There is nothing inherent to Java, C#, etc that mean that your program HAS to be bloated or use a lot of memory. Most of the time it happens for the same reason you see bloated and memory leaky C/C++ program: programmer inexperience or laziness.

  106. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 1

    Yes, but this frontend uses about 75 megs of RAM without anything running. When it's actually doing something it uses around 175 megs of RAM. The fact that Firefox can use more on start up with no tabs open is not a positive for Firefox.

  107. Re:How about a REAL C++ feature.... by Sir_Lewk · · Score: 1

    Just because one can understand memory allocations and pointers doesn't mean one wants to have to deal with them manually in all their programs.

    As I read it, all the GP was saying is that if you don't understand them then you don't have any business doing anything with C/C++.

    --
    "linux is just DOS with a UNIX like syntax" -- Galactic Dominator (944134)
  108. What's with the back(s)lash? by jonaskoelker · · Score: 2, Funny

    Or, lack of a proper lambda.

    I think \bigger problems

    Is that backslash some kind of Haskell joke?

  109. Re:How about a REAL C++ feature.... by Freetardo+Jones · · Score: 2

    No, he was saying that if you weren't a C++ programmer that you should leave the industry as if being able to program C++ and knowing pointers and memory management was some sort of godlike skill. The people who bluster on about how they know about memory management and pointers are usually the ones who write some of the leakiest code around.

  110. Re:Who cares now? by jonaskoelker · · Score: 1

    this is a thread about C++. Not Perl

    Just wait until you see the guy's APL code! :-O

  111. Re:How about a REAL C++ feature.... by blindd0t · · Score: 1

    There's generally more than 1 cook in the kitchen, especially when you consider the direct and indirect use of third-party code. Besides, "good programmers" is not the same as "perfect programmers." They are people, and they naturally prone to honest mistakes and oversights like ourselves and everyone else. I also can't imagine anything applications you have in mind (given your descriptions of browsers, word processors, pdf readers, etc...) is limited to anything even close to a single developer.

    Additionally, there is error with everything that is made. Even something coming off a factory line isn't the same every time, and has room for error/failure. The failure rate is a large part what determines whether something is designed & manufactured well, not the fact that any failure is inevitable. Even so, the quality of product support in the event that failure does occur is equally as important as initial prevention measures.

    Now when it comes to source code specifically, "safe" is relative to a number of things. Whether or not code is safe from being exploited to compromise a system is one thing, but there is also security of the information in which the application deals with, security of the intellectual property (hence why obfuscators are commonly used with managed languages), etc... Nothing is ever completely safe from every risk and hazard out there.

  112. Re:How about a REAL C++ feature.... by arth1 · · Score: 1

    The problem is the amount of C programmers/thinkers who think they're writing C++ just because they type "class". It doesn't work that way, C++ is a totally different language.

    Could that be because Bjarne first named it "C with classes"?

    Arrays are evil. C++ should have skipped arrays and gone directly to std::vector.

    I would claim that libstdc++ is what makes it a totally different language, not core C++. Drop the std additions, and you pretty much have "C with classes".

  113. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 1, Insightful

    And how do you think those other languages were written?

  114. Re:How about a REAL C++ feature.... by dgatwood · · Score: 2, Informative

    It's not necessary to check a return value if you don't care if the action succeeded or failed. One could reasonably argue that (at least in GUI application) printf qualifies as just such a throwaway statement.

    As for returning an exit status, AFAIK, both C99 and C++ codify that a main() function should implicitly return zero if the end of the function is reached. Thus, that's also correct, although one could argue that the behavior was OS-dependent back when that code was originally written, and thus it has only become correct in the past decade or so. :-)

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.

  115. Re:How about a REAL C++ feature.... by Razalhague · · Score: 1

    Yes, the ones that have never programmed anything other than "Hello World!".

  116. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Any garbage collected language requires more memory to operate than the program actually needs.. Otherwise you'd be garbage collecting 24/7. So yes, if you want to minimize GC cycles/pauses, your memory usage can be vastly higher than what the program would actually require in a traditional language. That's probably the big reason, for example, that the iPhone doesn't support GC in its Objective-C implementation.

    When i need to do something optional in a program i know takes a lot of memory in java (indexation for ex) i use the Process class - there is a bug, but it can be worked around) to fork a jvm, so that the memory used can be returned to the O.S. later.

    I would prefer a real dynamic garbage collector though.

  117. Re:How about a REAL C++ feature.... by Punto · · Score: 1

    Newsflash: your magical language that makes everything secure is implemented in C/C++

    --

    --
    Stay tuned for some shock and awe coming right up after this messages!

  118. Re:How about a REAL C++ feature.... by Z34107 · · Score: 1

    uTorrent vs. Azureus.

    Not even 7MB of memory usage with 10 torrents going.

    Now, explain how the drag-and-drop .NET program even comes close to approaching the functionality of Firefox, or OpenOffice, or even uTorrent.

    --
    DATABASE WOW WOW
  119. oh crap by Punto · · Score: 1

    I was looking forward to a language called "cocks", to bring some fresh air to the old flamewars...

    --

    --
    Stay tuned for some shock and awe coming right up after this messages!

  120. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Firefox memory usage is a mystery to me. I can't conceive of how it uses so much memory just to show a few pages of text with embedded images. The other browsers aren't really far behind though so maybe I'm missing something.

    Didn't you get the memo? Firefox does NOT have a memory issue. Perhaps you just haven't configured it correctly. First, open and edit a text file...

  121. Re:How about a REAL C++ feature.... by farnsworth · · Score: 2, Informative

    Where are they? If C# and Java are so great, where are the apps?

    gmail, amazon, your online banking, etc.

    Firefox memory usage is a mystery to me. I can't conceive of how it uses so much memory just to show a few pages of text with embedded images.

    Modern web standards are extraordinarily complicated. The current html spec is 756.93 KB alone. Add to that css, js, xml, http, etc. Add to that compatibility with the millions of existing web pages, and all of a sudden you have a ton of complicated code in order to display "a few pages of text".

    --

    There aint no pancake so thin it doesn't have two sides.

  122. Re:How about a REAL C++ feature.... by HonIsCool · · Score: 1

    If you are Doing It Right it's also impossible to get a "buffer overflow" in plain C...

    About the lack of a standardized smart pointer, there is std::auto_ptr since C++98, which I tend to use quite frequently.

    --
    "Give me six lines of C++ code written by the most competent programmer, and I will find enough in there to hang him."
  123. Re:How about a REAL C++ feature.... by AnyoneEB · · Score: 1

    Languages don't make things automatically safe, but they can help. Memory safety and type safety are properties of a programming language that make entire classes of errors impossible. Of course, you can write bad code in any language, but, say, a having code execute via a buffer overflow is pretty unlikely in Java unless there is a bug in the Java implementation.

    I have pretty much no experience with C++, but it sounds like using the features which are not memory or type safe is strongly discouraged (which I assume could be checked with static code analysis), so it is a bit misleading to suggest that languages like Java and C# are "better" than C++ due to having those safety features.

    --
    Centralization breaks the internet.
  124. Re:How about a REAL C++ feature.... by Tsujiku · · Score: 1

    I'm not sure you have any idea what you're talking about.

    You're comparing something that's highly rich in features, like Firefox, to an extremely bloated frontend. If it uses 75 megs of RAM to run something extremely simple, what do you think would happen with something just as complex as Firefox? Does extrapolation mean nothing to you?

    --
    Paradox
  125. Re:How about a REAL C++ feature.... by QRDeNameland · · Score: 3, Insightful

    And btw before someone mentions something like Azureus as a counterexample, I've seen Firefox still eat up more RAM than that program if they are running for the same period of time and that's with about 10 or so torrents running in it.

    And just as pointlessly, I've seen Photoshop eat up far more memory than my Java "Hello World" program. Seriously, pitting a modern web browser to a BitTorrent client to compare the languages used to code them is beyond absurd.

    As someone else noted below, compare Azureus's memory footprint (as well as speed and responsiveness) to uTorrent, which has virtually identical functionality to Azureus but is written in C++.

    --
    Momentarily, the need for the construction of new light will no longer exist.
  126. Re:How about a REAL C++ feature.... by StackedCrooked · · Score: 1

    Firefox has the Gecko engine which is sort of like a VM on its own for running XUL based apps. That's probably where the bloat comes from, not from C++.

  127. Re:How about a REAL C++ feature.... by petermgreen · · Score: 2, Interesting

    Like the guy who wrote Hello, World. Completely safe.
    It is because of both it's triviality and the fact it doesn't deal with untrusted data (or any data).

    Real systems are a lot more complex and they often have to deal untrusted data. Noone is perfect and it is almost a certainty that a coder will overlook something or make an incorrect assumption sooner or later. Of course some coders will do it more often than others. If they are lucky they spot it during testing and/or it is not exploitable. If they are unluky they have just introduced a security hole.

    You can reduce the bug rate in code by hiring better programmers or by doing a lot more testing and inspection of code, but you quickly get into very high costs and diminishing returns and some bugs still slip through (see: NASA).

    C (and some C++ subsets*) has very little checking built into the language. As a result of this it is easy to end up with bugs that allow overwriting memory the code was never meant to even touch and thus allowing injection of code.

    *C++ is a huge language (it's not quite a strict superset of C but it's pretty close) with an even bigger standard library. Some constructs in it are much safer than others and so it's vulnerability depends on what subset you work with.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  128. Re:How about a REAL C++ feature.... by BikeHelmet · · Score: 1
  129. Re:How about a REAL C++ feature.... by BikeHelmet · · Score: 1

    But if you do that you may as well code in Java.

    Most of C++'s superior performance disappears when you start using what are referred to as Collections in Java. ArrayList, Vector, etc. are lean and mean - I suppose because like most Java base-classes, they were coded by someone knowledgeable in C.

  130. Re:How about a REAL C++ feature.... by Joce640k · · Score: 1

    auto_ptr is awful, absolutely useless for actual memory management (eg. can't be used in std::vector) and not really very "smart" at all.

    --
    No sig today...
  131. Re:Hmm. by Anonymous Coward · · Score: 0

    Sorry, Slashcode fucked up my code.  Jews is a vector of pointers to Jew objects:

    std::vector<Jew*> Jews;

    I am not using C++0x, so my code as written is proper.

  132. Re:How about a REAL C++ feature.... by Joce640k · · Score: 2, Insightful

    "Could that be because Bjarne first named it "C with classes"?"

    It's because writing good C++ requires a lot of patience and self-discipline, something that most "programmers" simply don't have (or they're always up against a deadline or some other excuse for "just get it working, we can tidy it up later",- which never happens and you go into a downward spiral).

    --
    No sig today...
  133. Syntactic sugar, no more. by loufoque · · Score: 3, Informative

    C++0x adds syntactic sugar, no more.
    I'm actually relieved to see concepts dropped, that was probably the biggest useless sugar ever (axioms were not just sugar, but they were the part less ready for inclusion anyway). Everything concepts can do can already be done in C++03 with SFINAE with expressions (which, thankfully, was required explicitly in C++0x unlike C++03 which is quite vague on that topic).

    Lambdas are monomorphic, thus useless. Even a DSEL can do better. Worse, even MACROS can do better (since there is no stupid limit on templates being declared at file scope anymore).
    Rvalue references is just broken magic; relying on NRVO works just fine to implement move semantics and is not as senseless.

    The only real update that comes with C++0x is fixing the standard library so that it doesn't require stuff it doesn't need. Nothing developers haven't already solved by implementing their alternative to the standard library.

    Yet, C++ remains the most awesome language ever.
    Too bad the committee isn't working on actually useful additions, such as virtual templates, which would allow it to compete with dynamic typed languages such as Python.

  134. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 2, Insightful

    eg. If you're Doing It Right then it's impossible to get a "buffer overflow" in C++.

    Is it? STL iterators (and therefore containers) do not guarantee (and usually don't provide) any bound checking, so they aren't really any safer than good old memcpy in that respect.

  135. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 1

    std::tr1::shared_ptr is a de facto standard now (since both g++ and Visual C++ support it in latest incarnations).

  136. Re:How about a REAL C++ feature.... by Joce640k · · Score: 1

    The "elephant in the room" problem with GC is that computer resources are more then just "RAM".

    As soon as you start adding files, network connections, etc. into the mix then you start having to do manual memory management in Java - where it's really verbose (you have to do it manually, *every time* you use a file) and easy to forget (you have to do it manually, *every time* you use a file).

    In C++ the compiler writes the calls to finalize() for you automatically. You can't forget, because you never have to remember to do it.

    Garbage collection seems like a good idea but in practice it fails miserably and ends up being more work and more error prone than managing RAM in C++ ever was.

    --
    No sig today...
  137. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0
    "That's funny cause I've never seen a single C# or Java app."
    Obviously you're still in emacs land.

    Try eclipse (java) or VS2008 (really more .NET/C# nowadays), when you're programming C++ app. Much easier and more powerful with true wysiwyg..

    Reason why the main apps are still C++:

    backward compatibility. And considering all the "guru" developers tried JDK1.0 and C# 2.0 and said "noway this stinks"--yes, they were too buggy, slow, and ... cutting edge. Guess what? C++ had the same reception when it first came out compared to C. BUT since the gurus got proficient in C++ by the time JDK2.0/C# 3.0/Mono/Python became mature, they poo-poo those high-level languages. And that's a flaw with the S/W development community I hope changes as newer languages like Scala, Ruby and D move forward... The new languages have untapped potential and if you can meld old concepts with new languages results in better code.
    Try Java/C# now and it supercedes C++ in capability and development time. And you can always go unmanaged/native if you need backwards capability or specific performance. I sure if Mozilla could turn back the clock, we'd be on a JDK/hotspot-ish browser with threads on dedicated cores and DnD between the desktop and browser with proper security... and without bloated flash apps.

  138. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 3, Interesting

    The use case for auto is stuff like this:

    std::map<std::string, std::vector<int> > m;
    for (std::map<std::string, std::vector<std::int> >::iterator i = m.begin(); i != m.end(); ++i)

    There's absolutely no good reason why I have to spell out the map type in full twice on two adjacent lines of code. Yes, one can use typedef, but it actually makes code harder to read (I'd rather see std::map<...>, and immediately know what is meant, than see MapOfFooBar, and try to guess if it's std::map, or std::multimap, or maybe one of the fancy Boost containers, or a custom class). With auto, this becomes:

    std::map<std::string, std::vector<int> > m;
    for (auto i = m.begin(); i != m.end(); ++i)

  139. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 4, Informative

    Take a look at something like Acronis TrueImage (or any Norton program) before/after their transition from C++ to C++-with-C#-user-interface.

    As someone who worked in Acronis, and wrote a bunch of code for True Image, I feel obliged to tell you that there's no C# code in it at all - it's all pure C++. Acronis SDK (which is a separate thing, and IIRC comes only with True Image Enterprise) has component that exposes .NET API, and that's written in C#, but it's separate from True Image proper, and those C# APIs are just sanitized wrappers on top of the original COM API (which is implemented in C++), and, in fact, most of C# code there is automatically generated from COM interfaces (I know that because I'm the guy who originally designed that part of it).

    As for GUI in True Image (and pretty much all other Acronis products) - it's FOX Toolkit, or rather, forked and heavily-customized version of it (since it's LGPL'd, you can request the source code with customizations here).

  140. Re:How about a REAL C++ feature.... by HonIsCool · · Score: 1

    Several buffer overflows have been found in DJB's software, cf Guninsky.

    --
    "Give me six lines of C++ code written by the most competent programmer, and I will find enough in there to hang him."
  141. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 2, Interesting

    And there are times when you want the memory management code for performance, and you can't get to it.

    That's actually one thing I appreciate about C# over Java - it defaults to GC and memory safety, but it also has raw pointers with arithmetic, stack allocation, unions, and unchecked fixed-size buffers for when you need them.

  142. Re:How about a REAL C++ feature.... by HonIsCool · · Score: 1

    Yeah, it's a shame it doesn't play along with standard containers, but it's still very useful. I use it mostly for the ownership semantics (which is what's causing problems with standard containers...). Very helpful in keeping track of resources...

    --
    "Give me six lines of C++ code written by the most competent programmer, and I will find enough in there to hang him."
  143. Re:How about a REAL C++ feature.... by Marcos+Eliziario · · Score: 1

    Open firefox with a blank window on windows 7, open process explorer. about 35MB.

    Now, open gmail

    100 MB....
    do nothing, javascript garbage collector kicks in.... 70MB

    Let gmail or any other ajax app who has a loop continuosly checking against a server running for hours.

    Chat with integrated gtalk, open some google documents.....

    Most javascript implementations have some memory leaks. With time those leaks add up.

    Now, try writing the javascript engine with a managed, garbage collected language. Ping me if you survive the experience.

    --
    Your ad could be here!
  144. Re:How about a REAL C++ feature.... by Joce640k · · Score: 2, Insightful

    Code is complex, sure, but where does the RAM usage come from? At the end of the day the data being processed is a few kb of text and some bitmaps.

    --
    No sig today...
  145. Re:How about a REAL C++ feature.... by Achromatic1978 · · Score: 1

    Blacks are the angriest people you'll ever meet. Just don't look up when you talk to them or they'll beat the shit out of you...unless you're a fat white woman.

    Lisa Lampanelli, is that you?

    (Seriously, is that "comedian" capable of talking about anything other than what black cock she last sucked or fucked?)

  146. Re:How about a REAL C++ feature.... by mdwh2 · · Score: 1

    In other words, your point was a straw man.

    When people say Java is slower or more bloated, they obviously don't mean that every Java program is slower or takes up more memory than every single C++ program. For heaven's sake, think!

    (Although the reason I finally gave up on Java was because the GUI toolkit was so damn buggy. This was a few years ago, though.)

  147. Re:How about a REAL C++ feature.... by n+dot+l · · Score: 1

    There are also cases where you genuinely cannot know the exact type of the variable you want to declare, but where the compiler already does:

    template< typename A, typename B >
    void foo( const A &a, const B &b )
    {
        some_type temp = a * b;
        if( temp < 0 )
    //...
        if( temp < 1 )
    //...
        if( temp < 2 )
    //...
    }

    The function, as I intend to write it, doesn't care what types A and B are, only that operator* is defined between them, and that the result of operator* supports operator<( int ). What, besides auto, replaces some_type without pushing additional constraints onto the callers of this function?

    The only thing I can do right now is either replace each reference to temp with (a * b), which sucks if operator* is nontrivial, or I can add additional constraints to the valid types for A and B, pushing responsibility for foo's implementation details down onto its callers (which also sucks).

  148. Re:How about a REAL C++ feature.... by mdwh2 · · Score: 1

    I'd take C++ over C. And you might just as well say "between C++ with assembler, Haskell, and Python & co, there is no space left to be filled by C".

  149. Re:How about a REAL C++ feature.... by Timothy+Brownawell · · Score: 1

    eg. If you're Doing It Right then it's impossible to get a "buffer overflow" in C++. Most of the exploits you see are down to buffer overflows so I leave you to draw your own conclusions about the programmers.

    operator[] doesn't guarantee bounds checking, so overflows are still possible. Also, you can get much the same effect by not memorizing the iterator invalidation rules for the various containers.

    Problems with C++ that will catch C programmers:

    • Lack of a standardized smart pointer. That would have made a huge difference.

    std::shared_ptr<>, Coming Soon (tm).

    • Arrays. Arrays are evil. C++ should have skipped arrays and gone directly to std::vector.

    Yes, and it should also have made it impossible to instantiate classes on the stack or as members of an other class/structure, so you always have to use pointers/references. But some people like not being forced to use the heap for everything.

  150. Re:So in reality we shouldn't use it until 2015 th by jamesswift · · Score: 1

    " how many years before we can trust that most compilers can use it effectively... two, three?"

    FYI, you can use a lot of it already http://gcc.gnu.org/projects/cxx0x.html
    It's a fair bet that by the time it's signed off most of it will be available in gcc and you'll have an 'effective' implementation.

    How quickly your shop upgrades compilers is a different problem.

    --
    i wish i could stop
  151. Re:How about a REAL C++ feature.... by mdwh2 · · Score: 1

    Except you can still end up with memory leaks in Java, if there's a reference to the memory somewhere.

  152. Learn Haskell... by Anonymous Coward · · Score: 0

    I don't know why people continue to self flagellate themselves on C++.

  153. Re:How about a REAL C++ feature.... by Darinbob · · Score: 2, Informative

    Yeah, the C with classes is a nice language. The C++ with std:: stuff can be a bit of a mess. The reason for arrays is that they're still much faster than vectors because compilers haven't figured out how to optimize a complex templates very well. If C++ wasn't used in an area where speed matters, then maybe you could get away with replacing fundamental types with compile time add-ons.

  154. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    You don't actually understand what the word "safe" means in a language context, do you?

    But hey I guess any random pseudo-intellectually-superior fart noises will get a +5 around here.

  155. Re:How about a REAL C++ feature.... by Crimsonjade · · Score: 1

    There are plenty of cases where C is preferred over C++. The extra features C++ has are not without a cost.

  156. Re:How about a REAL C++ feature.... by dgatwood · · Score: 1

    Whoosh.

    --

    Check out my sci-fi/humor trilogy at PatriotsBooks.

  157. Re:How about a REAL C++ feature.... by Joce640k · · Score: 1

    So ... no actual desktop apps then?

    --
    No sig today...
  158. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Utter bullshit: I WORK FOR ACRONIS-- YOU ARE CAUGHT. If you are really an employee of Acronis, what is Jason's mother's maiden name.

  159. Re:How about a REAL C++ feature.... by alexmin · · Score: 1

    Wake me up when MS rewrites windows in C#. Or Sun/Oracle releases JVM written in Java. I refuse to eat their dogfood until vendors do the same.

  160. Switching away from c++ is difficult. by tp_xyzzy · · Score: 3, Interesting

    Every time I try to start using some other language, it fails. Mostly because other languages do not provide necessary tools to build correct programs.
      1) java failed to support variables in stack, and the whole VM/GC thing is horrible.
      2) haskell failed in supporting for-loops (MapM_ is not exactly the same thing)
      3) erlang failed when it made it too difficult to use existing libraries made with some other language
      4) python failed when it's performance is not very good
      5) C# failed because it's from microsoft
      6) C failed because of it's lack of support for abstractions

    So I keep coming back to c++ every time. It provides combination of performance, low level programming, high level programming, good abstractions, rich tools to build your programs, proper tools for debugging your programs, plenty of libraries available, caveats are well known and workarounds exists, and it keeps working year after year without any compability problems in all supported environments.

    C++0x dropping concepts is a big news. This is because c++ is important. It also means that the concepts proposal was not good enough. Only the best proposals will survive. If concepts needs to go, then they go. C++ is too important to get ruin by proposals that do not work or leads programmers to deadends. Concepts looked like a fine proposal at first, but seems it was still not good enough.

    This might make other languages think they're progressing faster and providing new features faster. The other languages are still struggling to provide even basic support for things that programmers need. It's not the new features that the languages provide that determines if the language is useful. It's what the language fails to provide that counts. If there are big gaps in it's support, the tool is just unusable for use.

    1. Re:Switching away from c++ is difficult. by Abcd1234 · · Score: 1

      1) java failed to support variables in stack, and the whole VM/GC thing is horrible.

      Uh, variables on the stack isn't required to build "correct programs". Meanwhile, I would argue that a GC *helps* you do just that.

      haskell failed in supporting for-loops

      Haskell failed because of *for-loops*? WTF?

      Heck, even if that made any sense (which it doesn't, at least to my feeble brain, as, AFAICT, for-loops aren't even necessary, let alone a deal-breaker), how is mapM_ not perfectly sufficient?

      4) python failed when it's performance is not very good

      Also not "required" for making "correct programs". Is Python necessarily suited to all application domains? No (although it's strong FFI means you can probably use it for most). But it's still a perfectly fine language when used appropriately.

      5) C# failed because it's from microsoft

      ROFL, how does that stop you from building "correct programs"? Oh right, it doesn't. It's just blind dogma.

      Frankly, it sounds to me like you're just looking for feeble excuses so you can slink back to the comfort of C++.

    2. Re:Switching away from c++ is difficult. by blancolioni · · Score: 1

      haskell failed in supporting for-loops (MapM_ is not exactly the same thing)


      for lo hi action = mapM_ action [lo .. hi]

      for 1 4 print
      1
      2
      3
      4

      I don't see how this relates to correctness though. The nice thing about for in most languages is its termination guarantee; you don't get that in the C++ version.

    3. Re:Switching away from c++ is difficult. by tp_xyzzy · · Score: 1

      1) java failed to support variables in stack, and the whole VM/GC thing is horrible.

      > Uh, variables on the stack isn't required to
      > build "correct programs". Meanwhile, I would
      > argue that a GC *helps* you do just that.

      Here's how the logic works. Java removed one of the important features of c++, which is stack variables. The result of this decision was that they need to use very complex tool (the heap) to manage memory of all objects. Then they use GC to patch the earlier bad decision. So GC just tries to patch a problem that java created in the first place. The problem does not exists in C++. In java's case, the complexity caused by heap allocation is a reason why java failed.

      2) haskell failed in supporting for-loops

      > Haskell failed because of *for-loops*? WTF?
      >
      > Heck, even if that made any sense (which it
      > doesn't, at least to my feeble brain, as,
      > AFAICT, for-loops aren't even necessary, let
      > alone a deal-breaker), how is mapM_ not
      > perfectly sufficient?

      Important feature of loops in C++ is that you can move away much of the code from inside the loops as possible, because that code gets executed millions of times. So any extra instructions that you cannot get rid of when writing a loop is bad for your performance. Try writing any algorithms for image manipulation if your loops to go through pixels and _modify_ the image, if your MapM_ contains function calls inside the loop! And I'm not even talking about what monads make your image manipulation for-loops to do...

      4) python failed when it's performance is not very good

      > Also not "required" for making "correct
      > programs". Is Python necessarily suited to all
      > application domains? No (although it's strong
      > FFI means you can probably use it for most).
      > But it's still a perfectly fine language
      > when used appropriately.

      One of the correctness criteria is that the resulting program is fast enough.(I don't want to wait weeks to get result from the program.)

      5) C# failed because it's from microsoft

      > ROFL, how does that stop you from building
      > "correct programs"? Oh right, it doesn't. It's
      > just blind dogma.

      If the fact that it comes from microsoft causes that it won't work on my linux box or solaris box, then it prevents me from implementing one of the important requirements. C# might be useful for building PC applications, but useless for anything more complex. (it's no longer the case that every computer has windows in it and microsoft's support for other platforms is kinda bad). C++ has no such problems.

      > Frankly, it sounds to me like you're just
      > looking for feeble excuses so you can
      > slink back to the comfort of C++.

      Well, these were the reasons each of the language failed for me. Other people might have different reasons. And maybe they're doing different decisions on the language of their choice.

  161. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 1, Informative

    Java programs are pretty common. A lot of "internal business apps" are written entirely in Java. For example look at financial software (look up job postings for hedge funds), Operations/Supply chain tools (i2 ) or many other programs that gets outsourced to third parties (IBM, Infosys and others).

    These applications have the advantage of being run only on a specific configuration and so don't have to worry about the right JRE etc. Program size is often not a constraint and speed is pretty good. I have sometimes seen high frequency traders in stock markets code in Java.

    Don't diss Java just because very few commercial apps get developed in it.

    Same goes for C# - Microsoft convinced many large Java users to switch to C# (Dell was an early adopter). And nowadays anyone who uses Microsoft SQL Server uses C# to write apps around it.

  162. Re:How about a REAL C++ feature.... by grahamd0 · · Score: 1

    There was a time when people expected computers to be fast. But I guess in the world of web applications that dream will end.

    Computers *are* fast. Fast enough that people can have the relatively slow-running web apps they love. You're free not to use them of course.

    I'll get off your lawn now.

  163. Re:How about a REAL C++ feature.... by Joce640k · · Score: 3, Insightful

    Complete rubbish. Compiler writers aren't stupid, they know how to optimize std::vector. Go and disassemble some std::vector code before posting stuff like this.

    --
    No sig today...
  164. Re:How about a REAL C++ feature.... by AuMatar · · Score: 1

    Also amazon is about half Java half C++. The parts that need to be right and fast- written in C++.

    --
    I still have more fans than freaks. WTF is wrong with you people?
  165. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Shrink-wrap applications represent a tiny, tiny, tiny fraction of applications. Internal business applications are the vast majority and those are often written using Visual Basic, Java, C#, COBOL, etc. What you personally have seen represents a negligible chunk of the market.

  166. Moderation Problem. by istartedi · · Score: 1

    Parent is not a troll. Please fix. If you don't agree with him, the proper thing to do is argue with him, not moderate him.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  167. Respect your elders you fucking douchebag punk by Anonymous Coward · · Score: 0

    See subject because it's stupid little shits like you that know squat about this field that ought to get a good punch in the jaw to knock you the fuck out.

  168. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    As one that works in the embedded world ... I cringe at your cruel usage of the stack. Stack over flow ... bad. At least in virtual space with unmapped guard pages around the stack(s), the worst that will happen is a jarring MMU fault. In kernel space ... YIKES!!

  169. auto by Anonymous Coward · · Score: 0

    here's an example of why we need an "auto":

    template <typename parent_type, typename query_type>
    struct recursive_query
    {
            typedef recursive_query<parent_type, query_type> this_type;

            template<typename query_type>
            recursive_query<this_type, query_type> operator[](query_type q);
    };

    struct query_base
    {
            template<typename query_type>
            recursive_query<query_base, query_type> operator()(query_type q);
    };

    recursive_query<recursive_query<recursive_query<recursive_query<query_base, const char *>, int>, std::list<int> >, float> result =
            recursive_query<query_base>["foo"][5][my_list_of_ints][4.2];
    // or would you rather write:
    auto result = recursive_query<query_base>["foo"][5][my_list_of_ints][4.2];

    if you don't understand why you might need a recursive type like that, learn more about metaprogramming! it's the bee's knees!

    1. Re:auto by johnlcallaway · · Score: 1

      Maybe you need to learn how to define classes so you don't need the auto keyword.

      --
      I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
  170. Re:How about a REAL C++ feature.... by chthonicdaemon · · Score: 1

    So, if you're good with powertools you can be safe without guards, eye protection and hearing protection? I suppose you think that all the buffer overflow and memory leak problems we've seen in high quality software is because the programmers are no good. Nobody claims absolutes, but language features that make it easy to do the right thing make it more likely that people will do the right thing. Language features that allow you to do something that is likely to cause problems increase the risk that these problems will occur. That's just basic probability.

    I can tell you that I have had to debug off-by-one errors in Fortran and C (where no range checking is done, so you can easily end up modifying the next variable in memory rather than the last element of your array), but never in something like Matlab or Python where range checking is done. Now, that may make me a bad programmer, but show me the programmer who has never made a typo.

    --
    Languages aren't inherently fast -- implementations are efficient
  171. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    There is a reason why there are auto_ptrs in C++ and it's not because those people are "noobs", it's because people want to actually spend their time writing the program rather than having their time eaten up by writing tons of boilerplate memory management code.

    Actually, no.

    auto_ptr is useful for handling resource release when the stack is unrolled due to a thrown exception. There are technical reasons for it.

  172. Re:How about a REAL C++ feature.... by Abcd1234 · · Score: 3, Insightful

    Yes, if you need to grow your business and all you can hire are dumb@$$3$ then yes, stick with Java (or C#).

    Wow, so all the programmers you hire are perfect little automata that never make mistakes? Impressive! Where did you find such miracles of science?

    And how much of a hit in performance are you taking when garbage collector turns on? How many times a minute does it fire and what happens to all those threads that are blocking?

    Depends on the GC. There's a reason Sun provides a bunch of alternative implementations which have various performance characteristics that are better for different workloads.

    On the flipside, how often do you see a crash because of a bad pointer reference, or worse, a security hole available to the world because of a buffer overflow in the code your perfectly little automata hacked up?

    There was a time when people expected computers to be fast.

    They also expect them to be stable and secure. Hint: speed isn't the sole requirement for most applications, and in fact isn't even the top one most of the time.

  173. The problem with C++ by Eskarel · · Score: 3, Insightful
    is that it's losing it's niche.

    The advantages of C and C++ have always been the speed of execution, and it's ability to get really close to the hardware. The problem now is that the speed of execution advantage is fading. Interpreted byte code languages like Java and C# are getting faster and faster, and they byte code has always made them more portable. Add to that that the extra complexity of C++ is often unnecessary, and you start reaching a point where more and more applications which would once have been written in C++ are now being written in C# or Java, this trend is only likely to continue with more and more applications moving onto the web, and continued improvements in the byte code languages themselves.

    There is certainly still a need for C and C++, they are really the only viable languages for writing device drivers and certain core OS components, not to mention all the interpreters necessary for running all these byte code languages. The problem, as I see it, and I'm by no means an expert, is that C++ is continually trying to compete with languages like Java, which it will never be able to functionally do without giving up all of the things which make it powerful and which java can't do. Java is powerful because you don't have to worry about all the things you don't really care about, and C++ is powerful because when you do need to care about them you have the level of control you need(C# tried to allow both, but it doesn't really work that way). The more libraries and features you add to C++ to make it like java, the more complex and bloated you make it, and you're still chasing an unachievable goal because you can't make C++ into Java and you wouldn't really want to.

    I'm not sure why the language is going in this direction, but it seems to me better to use C and C++ where they're appropriate and use Java/C# where they're appropriate and to stop trying to create some jack of all trades language which can't exist.

    1. Re:The problem with C++ by CxDoo · · Score: 1

      You keep saying "C and C++" as if they are Siamese twins and should share the same fate. They are not.
      C is basically a glorified macro assembler and will never, ever, wane. When you talk to the metal, you will do it in C. When you do embedded, you will do it in C. When you need hand optimized, lightning fast code, you will do it in C. For things that it should be used for, C looks and feels good.

      Current state of C++ on the other hand is the result of decades of new ideas in programming being shoveled down C's throat. It can surely take it, but it looks ugly, feels ugly and will not get any better. C++ is obsolete. It might not die any time soon but it will slowly be replaced by more modern languages.

      --
      "Blah blah blah." - [citation needed]
    2. Re:The problem with C++ by Just+Some+Guy · · Score: 1

      is that it's losing it's niche.

      Yep. C++ doesn't have the bare-metal performance of C or the elegance of a modern HLL. Where is its sweet spot?

      --
      Dewey, what part of this looks like authorities should be involved?
    3. Re:The problem with C++ by Eskarel · · Score: 1

      I put them together because they both have the ability to write programs which have access to the bare metal and the guts of memory, which is the primary strength of the language class.

  174. Re:How about a REAL C++ feature.... by mqduck · · Score: 1

    That's the most brilliant metaphor I've heard in a long time.

    --
    Property is theft.
  175. Re:How about a REAL C++ feature.... by Overly+Critical+Guy · · Score: 0, Funny

    Not only are you completely flat-out wrong about "98%" of OpenOffice being C++, you also use the phrase "Bzzzt wrong," which makes you obnoxious.

    --
    "Sufferin' succotash."
  176. C++ has always been an ugly bastard by presidenteloco · · Score: 0, Troll

    son of C and an impure virtual function.

    Now you get 2, 2, 2 languages for the price of 1.
    N' delay pas. Acheter now!

    Please please let it die.

    Can't we use a decent 21st century language
    with embedded D or something for the
    bare metal access sections.

    --

    Where are we going and why are we in a handbasket?
  177. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    most of our vulns are in the Java code in our product. which makes up only about 30% if you go by LOCs. The rest is plain old C (not even C++). Programming mistakes are spectacular in C, but mistakes in any language can be a serious security problem. There is something massively more important than typesafe and memory safe, and something that C and C++ do badly (and Java is fairly weak at). Everytime people bring up typesafety as some sort of amazing feature that solves every problem I just roll my eyes. Most of the time when I run into people that gush praise for such a simplistic language feature I mention formal verification and their eyes glaze over. I guess formal verification isn't as cool of a buzzword, or it's just too process-oriented to be a quick and easy fix to all your problems. Sorry, but their ain't no magic bullet, you gotta work hard to make good software. (formal verification means you work hard, but when you're done you at least aren't guessing anymore about the correctness of your software)

  178. Re:How about a REAL C++ feature.... by ardor · · Score: 1

    C++ is being used in areas where speed matters. WITH templates. In fact, expression templates are one of the primary tools for writing fast code in C++ without having to go to a low semantic level, like in C. Using expression templates, I can write the actual expression, and the templates will unroll to form the optimized code. Yes, this is used in practice. Google for Blitz++ for an example.

    --
    This sig does not contain any SCO code.
  179. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    I've been working in C# with people who don't understand memory management. Now, where's my crowbar...

  180. Re:How about a REAL C++ feature.... by ardor · · Score: 2, Insightful

    Most of C++'s superior performance comes back once you start using metaprogramming. Note, modern C++ does not outperform Java because of low-level bit fiddling, it outperforms Java because of its ability to do work at compile-time. Once one starts to do this, it becomes apparent just how many class hierarchies actually never require run-time polymorphism (and only polymorphism at compile-time). As a result, the actual class hierarchies are dramatically reduced, because most classes in Java are just poor man's concepts (as in C++ concepts) or poor man's Haskell typeclasses.

    Also, C++ is multi-paradigmatic, and does not try to shoehorn everything into the OOP paradigm, which means the code can fit the problem better. For instance, I lost count of how often I use boost.lambda, or boost.phoenix, or bind, which all are sort of implementations of lambda.

    Then there are expression templates, which allows you to do things like matrix multiplications which even outperform Fortran.

    --
    This sig does not contain any SCO code.
  181. Real Engineering by NateTech · · Score: 1

    When so-called "software standards" include real Engineering testing and certification by third parties, civil liability for bad software that causes serious fiscal losses including lost time spent deploying bad software, and real repercussions for code monkeys that don't FOLLOW the standards, wake me up. Yawn.

    --
    +++OK ATH
  182. Re:How about a REAL C++ feature.... by chthonicdaemon · · Score: 3, Insightful

    Gotta have functions because expecting all programmers to know how to copy and paste large chunks of code when they use them isn't unfair to those who haven't gained those skills yet.

    When I'm programming, certain things set off red flags. If I see myself doing something similar many times, I extract that stuff into a function if "the thing" is parameterised by values. If it's parameterised in terms of types, I use a template, if there's obvious structure, I use a class. If it's small and gets done a lot, I use a loop. These structures are things that are not technically necessary for programming, but each mechanism cuts down on redundancy and reduces the chance of errors by having to remember where all the changes are. In addition, reducing the boilerplate makes it easier to see the structure in the program.

    The auto variable is an example of type inference, and the fact that C/C++ doesn't have it is really a nuisance once one has gotten used to languages with more powerful type systems like Haskell.

    --
    Languages aren't inherently fast -- implementations are efficient
  183. Re:How about a REAL C++ feature.... by spitzak · · Score: 2, Interesting

    He's only putting auto_ptr pointers on the stack, not whole objects. That is what he meant by "automatic".

    But also don't discount putting things on the stack. It's not a good idea if your functions are recursive, but for leaf functions it is. I just did some tests today, replacing a stl stringstream with a 256 byte stack buffer and using snprintf and it literally was 4 times faster. I wasted some time trying to improve the stringstream, by putting it outside the loop and clearing it instead of recreating it each time, and performance got worse (I think because the only way to clear it is to do s.str("") which created a temporary std::string and the compiler was too stupid to remove it). Changing the called code to take a const char* instead of a const std::string& did improve it about 1.5 times, but that was just doing a portion of the conversion to old fashined C code, and was still worse than the one that kept the std::string and used the buffer.

    Anybody who claims C++ stl stuff is just as fast is lying. They are safer (for instance nothing stopped me from sending the wrong number to snprintf, and my code did truncate if the answer was too big for the buffer, though I knew that the input (identifiers) would never be that long). But they are never faster, even compared to rather stupid code. I'm sure if I went and replaced snprintf with various strlcat calls it would be even better.

  184. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Languages don't make things automatically safe. Huge languages with retarded defaults, make things unsafe for sure.
    I once felt that standards-compliant C was a bit limited. I went to try C++ only to find out that it was a security nightmare. For each of the big features, there was an even bigger hole in the middle.
    Sure, many C library functions are insecure, and some algorithms are as well, still, the average programmer can learn C in an out with some effort.
    C++ is not only huge making learning all of the implications impossible, additionally it promotes insecurity by means of fatally flawed libraries.
    In C you have backwards compatibility requirements, in C++ you just have retardation. The whole standard c++ library should be thrown down the sewage, then templates need to be included properly in the language without weird syntax and verbosity. Then and only then, can C++ be taken seriously.

  185. Re:So in reality we shouldn't use it until 2015 th by MadKeithV · · Score: 1
  186. Re:How about a REAL C++ feature.... by John+Betonschaar · · Score: 1

    Yes, but you will dump core with a bad_index or an assertion if you write outside iterator bounds, instead of overwriting arbitrary memory, opening up opportunities for exploits.

    In Java, C# or about any other language I've ever programmed indexing outside the bounds arrays or other containers will b0rk your program, it's all about _how_ it borks, and in that regard C++ code that only uses STL (properly) is pretty safe against buffer under/overflow exploits.

  187. Re:How about a REAL C++ feature.... by Almahtar · · Score: 1
    Excellent point. Garbage collection is not an end-all solution. It's good for some things, but not all things.
    Working on a large flash game, I frequently ran into code like this:

    variableName = null;

    ... because Garbage Collectors work based on references. That line of code is directly equivalent to

    delete variableName;

    There were *more* memory leaks in that application than in any non-GC'd app I'd worked on, because programmers got lazy and figured GC would take care of everything for them.

    And that's just the first problem I have with GC. The client demanded this program be done in flash or no contract, so we were stuck with flash. Our graphics suffered a few framedrops every few seconds, and we determined it was due to Garbage Collection, which we have no controll over. Our workaround, which makes me sick to this day, was to allocate a bunch of random lightweight objects every few cycles to trigger their garbage collection more often.

    That just wouldn't have happened if we used C++.

  188. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 2, Insightful

    Yes, but you will dump core with a bad_index or an assertion if you write outside iterator bounds instead of overwriting arbitrary memory, opening up opportunities for exploits.

    Except that you won't. Alright, checked iterators are an option, which is normally disabled by default in release builds in all implementations that I know of. So normally your std::vector iterators are just thin wrappers over pointers with no checking. And, of course, an implementation that checks iterators can check pointers just as well.

    In Java, C# or about any other language I've ever programmed indexing outside the bounds arrays or other containers will b0rk your program, it's all about _how_ it borks, and in that regard C++ code that only uses STL (properly) is pretty safe against buffer under/overflow exploits.

    To reiterate: there's absolutely no guarantee of that. Dereferencing an invalid iterator is U.B.; moving iterator before first element, or more than one past the last element in container, is U.B.; std::vector::operator[] with out-of-bounds index is U.B. The only thing that Standard guarantees is that std::vector::at() will throw if index is out of bounds, and almost no-one uses that (I've yet to see it in production code). It is absolutely not like Java or C#, where you're guaranteed that any out of bounds index, or any invalid iterator/enumerator, will throw upon use and not corrupt anything.

  189. Re:How about a REAL C++ feature.... by ardor · · Score: 1

    Its not that they don't want to. Often, they could do it with their skills, but other factors stop them from doing so. Like, budget, deadlines.

    Of course there is also the fact that people are lazy, and it is just so inconvenient to worry about writing that parser with security in mind, right? "It is not motivating, and I want to see something cool, so lets hack the parser, I will do it properly later" (which never happens) ...

    --
    This sig does not contain any SCO code.
  190. Re:How about a REAL C++ feature.... by gr8dude · · Score: 1

    As someone who worked in Acronis, and wrote a bunch of code for True Image, I feel obliged to tell you that there's no C# code in it at all - it's all pure C++.

    But how did it get so big then?

  191. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 1

    There are many ways to bloat a C++ program. For one thing, if you split it into lot of small DLLs, and heavily use templated libraries everywhere (STL, but also some in-house stuff), you get the same repeated bunches of template instantiations in every DLL. Another contribution to it was gratuitous use of code generators, and this gets especially bad when combined with templates from the first point (nothing like a code generator to produce as many instantiations as possible). I remember that at some point we actually started hitting MSVC .obj file format limitation of no more than 65536 symbols per .obj (every member in every template class specialization produces a distinct symbol).

  192. Meh by dublindan · · Score: 1

    Who gives a shit. They lost me when they first announced C++0x
    C++ was a great old language (sometimes, when the moons were aligned), but I've moved on. They needn't bother trying to patch up a patch up for an old obsolete language (and I do apologize to C fans.. I know I'm being harsh). Opinion, sure, but you gotta admit, we don't need a patched up C++.

    1. Re:Meh by kamatsu · · Score: 1

      C Good. C++ Bad. you seem to be implicitly equating them, this has flagged a type checker warning in my brain.

    2. Re:Meh by dublindan · · Score: 1

      Well, yeah, I was being a little harsh on C. Though C++ was a patch to try and bring new features to C (OO, templates, etc) and to fix things which were perceived as flaws (for example, having to define variables at the start of a function). It succeeded too, but also introduced much much more complexity, more undefined pits of doom and other flaws to the language. Now they want to patch this? I say no - switch to a language which never had these flaws to begin with and be done with it. Besides, how long will it take for compilers to really support C++0x anyway? By the time its fully supported, I'll hopefully have stopped using C++ entirely. (Yes, I still sometimes use C++)

  193. Re:How about a REAL C++ feature.... by Madsy · · Score: 1

    I strongly disagree.
    First off, you write C++ the moment your code is C++ standard compliant. C++ is a multi-purpose language, almost like a swiss army knife. People have different styles, and there are tons of ways to approach one single problem. Just because one is reluctant to use inheritance, RTTI and other features doesn't make ones code less C++'ish. I use C++ mostly for template and procedural programming, but I do use other features when they make the most sense as a solution.
    "If you don't use keyword/language semantic X, then you don't really *use* the language" is utter crap. Sorry.

    Second, your claim that you can avoid buffer overflows is theoretical at best. You don't seem to take performance into account. Sure, some people have the luxury to check the ranges in the overloaded subscript operator and throw std::out_of_range exceptions when something bad happens, but that's far from everyone. C++ is often a choice because of its performance.
    Third, removing support for old-fashion arrays would make C++ much harder to use on embedded platforms which are short on memory and/or have no memory allocation scheme. If you then have to write a custom allocator, nothing is gained. And why use vector when all you need is a fixed-size array as automatic storage. The construction overhead of a vector is rarely a problem compared to a old-fashioned array, but it can be.

  194. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    That's complete bullshit. An Iterator is not much more than a pointer. In fact, std::vector was specifically designed such that X* is a possible implementation of std::vector::iterator. And you pretty much can't avoid Iterators in C++.

  195. Where's a Foxconn secuirty agent when you need him by Anonymous Coward · · Score: 0

    A little, er. persuasion is in order here. Committees are what they are, but add some heat and they'll GET TO WORK and so can we.

  196. Re:So in reality we shouldn't use it until 2015 th by js_sebastian · · Score: 1

    I've been following C++0x for a long time now, and have been looking forward to it, but now I'm not so sure I'll ever use it. I was looking forward to Concepts more than anything and with that gone, it seems like a extremely minor upgrade. Also, even when the spec does come out, how many years before we can trust that most compilers can use it effectively... two, three?

    http://gcc.gnu.org/gcc-4.5/cxx0x_status.html

    It's not that bad. Many of the simple, neat features (like auto typing and initializer lists) are available already. Also, many of the library improvements are just standardizations of existing libraries, so it won't take that long for implementations to catch up. The main reason for all this is that one of the criteria for inclusion of a feature into the standard was the existance of an implementation. And this is why concepts were dropped. There is the conceptGCC implementation, but several people were not satisfied with the design of concepts that conceptGCC implements. If the decision was made to change that design, concepts were not standard-ready anymore (no existing implementation).

  197. C++ is demonstrably not a totaly different lang by Anonymous Coward · · Score: 1, Insightful

    Since C++ is a super set of C by definition, your suggestion that it is a totally different language is clearly wrong.

    As for, 'If you're Doing It Right then it's impossible to get a "buffer overflow"'. That's like saying if you don't make a mistake there won't be any mistakes.

    I suggest you take time out to reflect.

  198. Re:So in reality we shouldn't use it until 2015 th by master_p · · Score: 1

    The second big part is rvalue references. They really do give major performance benefits for STL containers, especially of user-defined types (as smart implementations of C++03 already optimize their containers for standard types to avoid copy by using swap instead - but they can only legally do it for types they control...).

    RValue references do not give any major performance benefits - it's the move operation that gives the performance benefit. RValue references can be emulated by templates in the current version of the language. RValue references is a notation for making move semantics available to the compiler. Move semantics are not magically supported. You still have to code the move constructor and the move assignment operator.

    Moving data around is a dangerous practice. Auto_ptr was considered bad exactly because of this - you don't know where your data may end up to. Moving data means more destructive updating. Modern programming language theory is slowly moving away from destructive updating, as it is much easier to do better optimizations when things are not allowed to be destructively updated. I expect that there would be a lot of problems in production code from this, when non-const variables will be passed to functions that reset the variables to their initial state; it would be the auto_ptr fiasco all over again.

  199. Re:How about a REAL C++ feature.... by fedxone-v86 · · Score: 1

    Spoken like a true Software Architect!?

    How about using a technology that doesn't need children crawl inside big machines, in the first place? But you're right. How dare I propose such a thing?

    The technology has always worked that way and it always will. Never touch a running system!

    And don't worry about the children. They're abundant and cheap. We're doing their parents a favour!

    Seriously, "not killing children unless there's a bug" isn't that great a software feature. My guess is you've been working with C++ for far too long. Maybe you should take a look around you and outside the C++ world. Modern software development is more like procreation :)

    And your paraphrase is wrong. God isn't responsible for letting the kid die. It was the guy who's specified the child go into the machine.

    --
    (USER WAS PUT ON PROBATION FOR THIS POST)
  200. Re:How about a REAL C++ feature.... by master_p · · Score: 1

    eg. If you're Doing It Right then it's impossible to get a "buffer overflow" in C++. Most of the exploits you see are down to buffer overflows so I leave you to draw your own conclusions about the programmers.

    Arrays. Arrays are evil. C++ should have skipped arrays and gone directly to std::vector.

    So is this correct?

    vector<char> a;
    int i;
    cin >> i;
    a[i] = 0;

    Let me give you a hint: it's not. It still allows for buffer overflows. Why is the operator [] not bounds-checked is beyond me. They could have had the operator [] safe and the function at() unsafe, if you really wanted such fast access.

  201. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    http://www.mozilla.org/rhino/

  202. Re:How about a REAL C++ feature.... by owlstead · · Score: 1

    Is this true? I understood that a mark & sweep GC as default in Java leaves some memory allocated, but a GC does not have to be mark and sweep. Especially if performance is less of a burden you could do GC for 24/7. You would loose some performance but you would gain memory. And then you could go and sit somewhere in the middle and use the G1 gc in Java, which trades in processor time in another thread. Besides, even compiled languages won't leave each and every piece of memory usable. Without anything to "collect the holes" a compiled language may be more of a memory burden when it is used as a service.

    If anything I think the meta-information used by the managed languages and scripts is much more of a memory burden than the garbage collection (although the Java implementation certainly leaves some things to be desired). You can strip a lot of that out of your Java application by removing all debugging information (and renaming all classes and methods), but your exception stack will look horrible without any line numbers etc. And Java is more about easy maintenance than anything else.

  203. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Most C++ features *don't* have a cost in performance. Among these are:
      - templates
      - RAII
      - namespaces
      - operator overloading
    virtual function calls do have a cost, but it's not larger than what you get when you implement the same stuff manually in C. Also, C++ can be a *lot* faster than C due to templates. Try sorting an array of doubles using qsort and std::sort. The C++ version will be faster, because you can avoid a function call. Additionally, qsort can only sort arrays, while std::sort can sort anything that provides random access (such as a std::vector and a std::deque).

  204. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    There is no way to avoid buffer overflows in any language. You just can't.

  205. Re:How about a REAL C++ feature.... by Kjella · · Score: 1

    Just because one can understand memory allocations and pointers doesn't mean one wants to have to deal with them manually in all their programs. There is a reason why there are auto_ptrs in C++ and it's not because those people are "noobs", it's because people want to actually spend their time writing the program rather than having their time eaten up by writing tons of boilerplate memory management code.

    Agreed. The absolutely sanest way I've found to develop is that memory follows objects. New instance? Memory allocated. Delete instance? Memory cleared. You fill up an object list = You run out of memory, but there's no "loose buffers" anywhere that you allocate somewhere but never gets cleared in the other end. If you really need to send "memory" around, send values (Qt has some really neat implicitly shared classes that means performance doesn't hurt much). I'd say almost all code can be written in a way that gives you 80% of the performance using only sane methods, and the reminder should probably have a assembler implementation with a standard fallback...

    --
    Live today, because you never know what tomorrow brings
  206. Re:How about a REAL C++ feature.... by PitaBred · · Score: 2, Interesting

    I know that. But C++ forces you to think about those issues, whereas Java/C# don't. That's why I recommend everyone at least learning a bit of C/C++, so they know where things come from. Do the development in Java, C#, Haskell, whatever. Have a ball. But realize that even if the language hides it from you, your structures and program still use resources. THAT is the problem I see coming from newer programmers.

  207. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    snprintf is faster than a stringstream simply because it does less. With stringstreams, you can build strings of arbitrary length, which forces the stringstream to allocate memory dynamically, which makes things slow. Of course, there is a way to avoid this: write your own streambuf that writes to and reads from a fixed-size buffer instead of a std::string. This way, you get all the stream goodness (for example, extensibility to user-defined types and type safety) without paying the cost for a feature you don't need.

    (captcha: impostor :o))

  208. C++ 2010 is a great leap forward. by Jesus_666 · · Score: 2, Funny

    Actually, this is part of a bigger shift in the C++ development community. From now on, a new C++ core edition will be released each year, with names in the format "C++ ". C++ 2010 (or C10 for short) will also contain a major overhaul of the C++ rules, intended to make it so that user's guesses about how the language works will most likely be correct. Here are some of them:

    - The long and short keywords are now #defined as static. This fixes issues with respect to variables using these keywords going out of scope before all functions using them have resolved. It also keeps them from being used more than once for the same variable.
    - Some of the terminology is changed. "to declare" is replaced with "to put on the battlefield"; "to free" is replaced with "to send to the exile" (or "to exile" for short). This is to make the language less confusing for new users. Also, functions are no longer "called" but "evoked", bringing back some terminology from the early days of the franchise.
    - Local variables will no longer be exiled when a block ends. This mechanic has frustrated many new users (as almost nobody can tell without looking it up where a block begins or ends) and thus the developers have removed it. They are aware that this breaks some peoples' coding styles but really think it improves the language.
    - Local variables no longer use the stack. The developers felt that putting local variables on the stack could create unintuitive situations and thus moved them to the heap.

    All in all C10 will be the best version of C++ ever. Prerelease events will be held shortly.

    --
    USE HOT GRITS WITH STATUE OF NATALIE PORTMAN (NAKED AND PETRIFIED)
    1. Re:C++ 2010 is a great leap forward. by kamatsu · · Score: 1

      Sounds like you're talking about some form of assembly language.

    2. Re:C++ 2010 is a great leap forward. by word_virus · · Score: 1

      I dunno how many other folks will get this as you're catering to a niche within a niche, but I laughed. Thanks.

  209. Re:How about a REAL C++ feature.... by ioshhdflwuegfh · · Score: 1

    Also, C++ is multi-paradigmatic, and does not try to shoehorn everything into the OOP paradigm, which means the code can fit the problem better.

    Or worse. multi-paradigm programming is akin to messy code. Lots of C++ code provides paradigmatic examples of this. Just like sort-of kind-of kind of argumentation of:

    For instance, I lost count of how often I use boost.lambda, or boost.phoenix, or bind, which all are sort of implementations of lambda.

    Then there are expression templates, which allows you to do things like matrix multiplications which even outperform Fortran.

    :D

    In reality, there are examples where C++ induces 5-10% run-time overhead compared to the same code in FORTRAN 77 when compiling numerically intensive code using classes/templates.

  210. Re:How about a REAL C++ feature.... by kamatsu · · Score: 1

    Firefox has it's own XUL and other abstractions that are nearly as involved as a Java VM.

  211. Re:How about a REAL C++ feature.... by thePowerOfGrayskull · · Score: 1

    Can you hack a barebones lynx?

    Well duh - lynx is written in C, which is perfectly safe. It's C++ that's the problem.

  212. But code doesn't go into headers. . . by JSBiff · · Score: 1

    I think this gets into where people abuse headers. I NEVER put code into header files (unless it's maybe a small macro which will get in-lined by the compiler for performance reasons). Headers get things like function and class definitions - which aren't code, they're just information for the compiler to use at compile time. Also, symbolic constants (e.g. #define RED 0xFF0000).

    I've not done much with Templates (I've not done much C++ coding in the past few years since I took some classes on it in college), maybe you'd put a template into a header, but again, that's something for the compiler to use at compile time, not code, IIRC?

    What else would you be putting in the header? How does that duplicate code? By writing a header file once and including it in other files, aren't you *reducing* duplication?

  213. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    You have missed the real purpose for the "auto" variable type. While you can use it to reduce the amount of code you type, it's real purpose is to define a typesafe variable of a type for which it is IMPOSSIBLE to write in your code (lambdas).

  214. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    OK, so ActionScript's GC seems to suck. How does that relate to GCs in general?

  215. Re:How about a REAL C++ feature.... by kamatsu · · Score: 1

    See Haskell.

  216. Re:How about a REAL C++ feature.... by ardor · · Score: 1

    Or worse. multi-paradigm programming is akin to messy code.

    Not necessarily. D is multi-paradigmatic with a much nicer syntax. C# has a nice functional core, even though it started as an OOP language. Do not let the C++ syntax problems fool you; C++ syntax sucks no matter what you want to do :)

    In reality, there are examples where C++ induces 5-10% run-time overhead compared to the same code in FORTRAN 77 when compiling numerically intensive code using classes/templates.

    5-10% is a margin where compiler flags and the used compiler are relevant. Also, there is always the possibility that expression templates weren't used properly..

    --
    This sig does not contain any SCO code.
  217. Re:How about a REAL C++ feature.... by rl117 · · Score: 1

    C++ does have standard smart pointer types. std::tr1::shared_ptr, std::tr1::weak_ptr etc. are all available in the Technical Report 1 extension to the C++98 standard. Many C++ programmers, including myself, make heavy use of these types.

    Regards,
    Roger

  218. another feature to wish for by Anonymous Coward · · Score: 0

    different people mention just yet one more feature that would make C++ compete with alternatives.

    I feel that that feature is Reflection
    (introspection) -- ability to find at runtime
    for each class
    methods names, arguments names and argument types to those methods, data type

    and platform independent serialization (both are related).

    This would give C++ ability to have Strong database access library (ORM),
    session management for stateless operations (via serialization)

    and therefore would allow creation of C++ web frameworks that have built-in ORM, session management, etc
    languag

  219. Re:How about a REAL C++ feature.... by Cassini2 · · Score: 1

    This conversation is what's wrong with C++. It is at least two fully independent languages, servicing at least two different interest groups. I'm not sure how relevant either group will be to long-term computing trends, like parallelism. However, first I am going to consider two groups of people that C++ services well.

    First, for the low level people, C++ is C with classes. These people want the ability to control every memory allocation and deallocation, although in practice, they only want control over some of them. The low level people use C++ as high-level assembly, and occasionally refer to the assembly print outs. The low level people still don't understand why C++ hasn't fixed it's pointer bug that would make numerical code as fast as FORTRAN. These people know what an interrupt handler is, and may have even written one. Accordingly, RAII and exceptions are explicitly banned from large segments of code.

    The second group of people actually use templates and RAII. The big advantage of RAII is that it handles all memory allocation automatically. It brings back the simplicity of the really old (pre-pointer) PASCAL and FORTRAN programs, where everything was allocated on the stack and no memory leaks existed. RAII's big contribution to programming is memory leak-free programming. This second group of programmers, want ease of programming as much as performance. The code they write, makes for very complex assembly. The second group is comparing C++ to languages like C#, Java and Haskell. They are interested in trading off the speed of program writing with the speed of execution.

    Some people will quickly point out, that other groups of people may exist. I think a few commercial projects have tried to blend the two extremes. In practice, I think C++ may be too overgrown to be a usable language. If the programmer wants to be safe, use Java. Otherwise, embrace the danger, and do the memory allocs and deallocs are manually, sometimes with custom memory handlers. Use the assembly, as the compilation is being done for speed. However, these are also yesterday's tradeoffs.

    Today, parallelism is the new speed optimization. For parallel programming, neither RAII or low-level C++ hacks create a good speed of programming vs. good speed of execution trade off. With multi-CPU, NUMA architectures, the applications need good memory control and multi-processor support. FORTRAN with some of its super-computer extensions is a better language for some of this stuff. Hadoop is uses Java.

    Where does C++ sit in this new trade-off? The new standard is silent.

  220. Re:How about a REAL C++ feature.... by Abcd1234 · · Score: 1

    As soon as you start adding files, network connections, etc. into the mix then you start having to do manual memory management in Java

    So don't use Java. C# has using blocks which call Dispose() on your object when they're exited, whether that be through normal program flow or abnormal exit.

    In short: don't assume all languages with a GC suck just because Java does.

  221. C++ is the new COBOL by Anonymous Coward · · Score: 0

    It's hopelessly outdated and crufty, but it will never go away because it's too big to die. Good thing that at least it's not evolving anytime soon, so people might start to look around for simpler, safer and more powerful languages to replace it. There are plenty.

  222. Re:So in reality we shouldn't use it until 2015 th by shutdown+-p+now · · Score: 1

    RValue references do not give any major performance benefits - it's the move operation that gives the performance benefit. RValue references can be emulated by templates in the current version of the language. RValue references is a notation for making move semantics available to the compiler. Move semantics are not magically supported. You still have to code the move constructor and the move assignment operator.

    I know about the rest of it (though obviously move constructor is enabled by rvalue references). But can you clarify the bit about "emulated by templates in the current version of the language"? I recall there being a few hacks, but wasn't they far from universal?

    Moving data around is a dangerous practice. Auto_ptr was considered bad exactly because of this - you don't know where your data may end up to.

    auto_ptr is dangerous not because it moves data, but because it does that in operations which have copy semantics for all other types - i.e. copy constructor, and operator=. In other words, it moved data regardless of whether it is safe or not. Rvalue references let one constrain move semantics such that it only gets applied when it is safe to do so.

    I expect that there would be a lot of problems in production code from this, when non-const variables will be passed to functions that reset the variables to their initial state; it would be the auto_ptr fiasco all over again.

    Non-const variables (and, in general, lvalues) don't bind to rvalue references, by design. So you won't get anything quietly moved from a variable, only from a temporary - that's why there's std::move added to allow you to explicitly request move-from-lvalue.

  223. Re:How about a REAL C++ feature.... by Tweenk · · Score: 1

    You would loose some performance but you would gain memory.

    Sometimes both performance and space are important, and then GC is inappropriate.

    Without anything to "collect the holes" a compiled language may be more of a memory burden when it is used as a service.

    Compiled languages do not imply no garbage collection. There is even a garbage collector for C, which lets you remove the "free()" calls from code: Look for Boehm GC or libgc. It does not always collect everything (it does not know aout types and an integer might alias a pointer), and if you do funny things like storing the color of a red-black tree node in the low bit of the pointer it will break horribly, but it works.

    --
    Those who would give up liberty to obtain working drivers, deserve neither liberty nor working drivers.
  224. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    To continue the analogy...

    The new, 'safe' machine still crushes children, but it hides it a lot better. In fact, while the old machine would only crush children when they stayed under it while it was coming down, sometimes the new machine would just randomly pick a child and crush it. However, when the new machine crushes children, it's "user error", but the old machine it was "a dangerous machine".

    The new machine is more efficient at dealing with a coarse weave fabric, but the old one would handle anything, including extremely fine, valuable fabrics, and would do it all with relative ease.

    However, anybody who only needed a machine which dealt exclusively with coarse weave fabrics immediately purchased this new machine, and decried that anybody using the old machine was stupid, failing to see the inherent superiority in this machine which crushed 10% fewer children, provided all the children were the slow and constantly making mistakes.

    Whatever happened to "the right tool for the right job"?

  225. Re:How about a REAL C++ feature.... by spitzak · · Score: 1

    Yes I would suspect that such a streambuf, along with some methods to reset/clear it and to get the char* pointer without copying, would get the speed up to match unless the compiler is really stupid.

    They could also write stringstream so it has a fixed-size buffer as part of the structure. I would not be surprised if 99.99% of the uses are 128 bytes or less. When the buffer overflows it starts allocating one. They also need to put a method to get a char* pointer directly, all legal things str() can call will copy the buffer and rvalue optimization does not help here. Yea the compilers put tricks in there such as secret string constructors but this is why we have unreadable error messages.

    I can tell you that figuring this out would be a hundred times harder than using snprintf. It is true that it could make up for it by allowing complicated objects to be printed, my normal solution has been to add a "print yourself to this buffer" call that uses stringstream internally, which adds up to the same complexity.

  226. I can start over? by argent · · Score: 1

    I'll even let you start over and not keep backwards compatibility with old code.

    Then I'd start over and not keep compatibility with C. Maybe use a Smalltalk-like syntax and encourage reflection. Dynamic typing and binding by default, maybe even relegate static typing to optimization with assertions. ... ... ellipses ... more ellipses ...

  227. Put a tail on it and callit a weasel... by argent · · Score: 1

    I have switched to C++ exactly because overloaded operators allowed me to program transformation in parametric domain (think Fourier) in a natural way, like C = B*A.

    And that's better than (set 'C (* B A)) why?

  228. Re:How about a REAL C++ feature.... by Paul+Dubuc · · Score: 1

    I once took a course in JBoss administration that included a section on tuning garbage collection. It convinced me that GC is a bad idea. It may make it easier for programmers but it shifts the burden for efficient memory management into a domain where it doesn't belong. Effective memory management is very sensitive to the design of the application. Shifting it to a generalized facility that runs garbage collection based on the short, medium or long duration of objects is an administrative nightmare. Someone writes an app that goes against the rules configured into the GC and the performance of the whole server suffers. So now we have training classes for Java programmers on how the GC works so they can write more efficient programs. How is that different from teaching C++ programmers a few simple code design disciplines (encapsulation, proper use of auto_ptr, etc.) to minimize memory management problems in their code?

  229. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Because C++ is the pinnacle of programming knowledge? *giggle*

    Are you trying to come over as a little school girl? (You succeeded.)

  230. Re:How about a REAL C++ feature.... by Darinbob · · Score: 1

    Compared "vector" with "int*" for three different architectures. The vector does take slightly more instructions, and this seems to be an extra indirection to get at the underlying array. This is likely to be amortized out in longer expressions, so I think this difference can be ignored.

    However that was with -O and a relatively newer GCC compiler. With -Os however the amount of generated code for vector was much greater, and the [] operator did not seem to be inlined. The -Os flag does get used a lot when memory space is tight.

    When C++ was new, the compilers were not really that great with optimization and being able to fall back to the C operators was very important. Without this I think C++ would have taken much longer to catch on in the scientific or systems programming areas.

  231. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Good. There's an overpopulation problem.

  232. Re:How about a REAL C++ feature.... by johnlcallaway · · Score: 1

    You mean when it the programmer isn't clever enough to figure out how to do it. Reread how to use classes.

    --
    I rarely read replies, it's my opinion and if you thought about your opinion a little more, I'm OK with that.
  233. Re:How about a REAL C++ feature.... by lannocc · · Score: 1

    How many Java browsers are out there? None? Case in point.

    I'm working on a fix for that. I could be doomed. :-P

  234. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    Thanks for the information. I'm interested in what toolkits commercial software vendors are using. I'd actually like to go back to C++ for personal and small commercial stuff. (I hate web programming.) What would be a good development setup to go along with the FOX Toolkit with respect to compilers or other tools? Free and cross platform have an appeal.

    I wish people would write some good articles about these kinds of things - what different companies are really using.

  235. Re:How about a REAL C++ feature.... by shutdown+-p+now · · Score: 1

    Personally, I don't have much liking for FOX. The main reason why Acronis is using it today is because in-house FOX fork has been ported to all kinds of things: not just Win32 and X11, but also Linux framebuffer (this is used for Acronis recovery CDs), and even EFI (this is fore special editions of Acronis products that are sold to hardware manufacturers to be embedded into sold hardware; imagine True Image restore module in your BIOS...). It's a pretty interesting port, too, because it tries to preserve look and feel of Win32 widgets (if you ever saw an Acronis boot CD, or Acronis boot loader, you should know what I mean).

    When FOX was originally chosen, Qt was IIRC still GPL'd and thus unusable in commercial settings, and there was a need for a toolkit that draws all its widgets itself (rather than a wrapper on top of OS or another toolkit), for those framebuffer and EFI scenarios.

    By itself, FOX is really just your basic C++ toolkit. I'm not aware of any special tooling existing for it, but even if it does, we just hand-coded all UI. So all you'd really need is a C++ compiler. Can't beat VC++ on Windows (I know it's not free, but there's a reason why virtually all commercial shops use it, and not e.g. MinGW, for Windows development); and, of course there's no contest with g++ on any other platform.

    We used VC2003, later migrating to VS2005, for all Windows builds, and g++ for Linux/MacOS/EFI (several different versions, I don't remember the exact ones, but it was 4.x by the end of it). IDEs? Well, Visual Studio provides very nice debugging experience on Windows (duh), and our hardened and brutal Linux guys mostly just used gdb directly. No idea about how OS X team handled it, but I'd guess XCode.

    Editor-wise, it was free for all. Some used VS, some Vim (including Vim/Win32), some Emacs (again, including Win32 port), a lot used the built-in editor in Far Manager with Colorer for syntax highlighting, and there were some even more obscure combinations.

  236. Re:How about a REAL C++ feature.... by Anonymous Coward · · Score: 0

    That's probably the big reason, for example, that the iPhone doesn't support GC in its Objective-C implementation.

    Yes, it does.

  237. Re:How about a REAL C++ feature.... by badkarmadayaccount · · Score: 1

    Rhino anyone? (FGoogle it yourself!)

    --
    I know tobacco is bad for you, so I smoke weed with crack.
  238. Re:How about a REAL C++ feature.... by badkarmadayaccount · · Score: 1
    --
    I know tobacco is bad for you, so I smoke weed with crack.
  239. Ah huh by Anonymous Coward · · Score: 0

    I've worked out the problem you guys (possibly girls too) all seem to have. You seem to think the purpose of the C++ committee is to, generally speaking, improve the C++ language. Given their conduct to date, I fail to see how you could arrive at such a conclusion. However, I will clarify the situation so that further confusion can be avoided.

    The purpose of the C++ committee is to guarantee that C++ IN NO WAY interferes with the popularity of C.

    Some of you will think I'm joking whereas the rest will know that I speak the truth. :(

  240. Talking of parrots by Anonymous Coward · · Score: 0

    My parrot changed sex today. That's not a joke. We always thought it was a male, and it also had the male colored beak. This morning... It had changed color entirely from blue to brown. It's a female now, and deeply fallen in love with an other parrot.

  241. Re:How about a REAL C++ feature.... by geniusj · · Score: 1

    No, it does not. Unless you're talking about auto-release pools, which still require a ton of hand-holding and I don't think anyone would consider a true GC.

  242. fnordRe:in related news... by Anonymous Coward · · Score: 0

    William Selden, Gertrude Tierney, Howard Bromberg, Howard Discount, Vernon Reeves and Jean E. Sammet.

  243. Re:How about a REAL C++ feature.... by bored · · Score: 1

    I wondered this myself. How can a few hundred K of HTML/javascript and images turn into 10-15M of memory usage. The only explanation is the DOM structures are being constructed and left in memory, and Javascript garbage collection/leaking.