Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Programming IT Technology

The Future of C++ As Seen By Its Creator 424

holden writes "In a rare public talk, C++ creator Dr. Bjarne Stroustrup discusses his ideal in programming languages, as well how he sees the next version (and beyond) of C++ developing. He explains the general selection criteria used for adding new features, some of the legacy of C++, and many other interesting topics. Especially interesting is during the Q&A he explains his views of the embrace and extend mentality some implementations, such as VC++, have taken."
This discussion has been archived. No new comments can be posted.

The Future of C++ As Seen By Its Creator

Comments Filter:
  • uh... (Score:4, Insightful)

    by cosmocain ( 1060326 ) on Monday August 13, 2007 @06:06AM (#20210265)
    ...transcript, anyone? i hate watching or listening to vids at work.
    • Re:uh... (Score:4, Funny)

      by neonmonk ( 467567 ) on Monday August 13, 2007 @06:08AM (#20210279)
      Agreed. I don't see the point in video unless they're actually showing up some fancy technology. ...Or, alternatively, they've got really nice jugs.
    • Re:uh... (Score:5, Funny)

      by LiquidCoooled ( 634315 ) on Monday August 13, 2007 @06:11AM (#20210299) Homepage Journal
      Good afternoon everybody, I would like to start by including iostream.h into the discussion.

      After this we can get onto the main proceedings which might or might not return anything.

      We move to the future by emitting a string of "Hello world" before returning zero.

      This is the end of the discussion I hope it was informative.
      • Re:uh... (Score:5, Insightful)

        by Pseudonym ( 62607 ) on Monday August 13, 2007 @06:45AM (#20210479)

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

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

        • Re: (Score:3, Funny)

          Stroustrup is an academic. Blowing by petty details for pedagogical reasons is a time-honored device.
        • Re:uh... (Score:5, Funny)

          by Odin's Raven ( 145278 ) on Monday August 13, 2007 @07:31AM (#20210711)

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

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

          I'm sure he only did that to ensure compatability with older members of the audience.
          • Re:uh... (Score:5, Funny)

            by Mr. Underbridge ( 666784 ) on Monday August 13, 2007 @07:44AM (#20210823)

            I'm sure he only did that to ensure compatability with older members of the audience.

            Then the joke should have been in COBOL.

            • Re:uh... (Score:5, Funny)

              by Anonymous Coward on Monday August 13, 2007 @11:52AM (#20213565)
              COBOL is already a joke.
            • I've only seen two. One is that there was a company Ryan McFarland that made a COBOL compiler for Unix named "rmcobol" - everybody thought that sounded like a good idea.

              The other came out on Usenet in the 80s and went something like

              Hey Rocky, watch me pull a computer program out of my hat!
              Oh, Bullwinkle, that trick never works!
              100 PROCEDURE DIVISION .... [couple more lines like that]
              Guess I oughta get another hat!

              Some of my coworkers got it, but a couple of them didn't. The disturbing part was that they r

      • Size of iostream? (Score:3, Interesting)

        by tepples ( 727027 )

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

        After this we can get onto the main proceedings which might or might not return anything.

        We move to the future by emitting a string of "Hello world" before returning zero.

        This is the end of the discussion I hope it was informative.

        Yes, all quarter megabyte of it. A Hello World program that uses <iostream> has been seen to take nearly that much space [pineight.com] when compiled with g++ and linked statically with GNU libstdc++, on fairly recent versions of both MinGW and devkitARM toolchains. Compare this to an equivalent program that uses only <cstdio>, at under 6 kilobytes each. (Actual source code, binaries, and makefiles are available on request [pineight.com].) This hurts especially on one of the platforms that devkitARM supports, which has only

      • Re: (Score:3, Funny)

        by Hoi Polloi ( 522990 )
        I skipped that meeting when I saw it was void. Can't get anything out of those things.
    • by dreamchaser ( 49529 ) on Monday August 13, 2007 @06:15AM (#20210323) Homepage Journal
      Video or audio just for the sake of being flashy is a dumb idea and I usually won't watch or listen. If I want audio and video I'll devote my full attention to my TV feed. Otherwise when I'm accessing information on the Internet I want text. I can read it far faster than someone speaks on a video interview for one thing, and for another text lends itself far better to (human)multitasking than video or audio does.
      • Agreed. Audio/Video presentations of what could be run through much faster as a simple webpage or pdf is becoming increasingly common and annoying. Hearing people talk about code is like listening to the audio of a person making balloon animals.
      • by Yvanhoe ( 564877 )
        Plus, it is more difficult for a non native speaker to understand than a written text.
        • Re: (Score:3, Funny)

          by nschubach ( 922175 )
          i cumpleetly understand wut ur sayin. its much esyer to reed things on teh internets than it evar wuz be4.
    • by jrumney ( 197329 )
      I don't mind watching videos at work, but at 101 minutes long, and with all of slashdot hitting it right now ... rebuffering 1% ..., I don't think I'll be watching this one.
    • It would be fine if there was a functional version of this:

      texttospeech --output-format simplehtml vid.txt
    • Re:uh... (Score:5, Funny)

      by cerberusss ( 660701 ) on Monday August 13, 2007 @07:50AM (#20210889) Journal
      Here ya go, buddy.

      Interviewer: Well, it's been a few years since you changed the world of software design, how does it feel, looking back?

      Stroustrup: Actually, I was thinking about those days, just before you arrived. Do you remember? Everyone was writing 'C' and, the trouble was, they were pretty damn good at it. Universities got pretty good at teaching it, too. They were turning out competent - I stress the word 'competent' - graduates at a phenomenal rate. That's what caused the problem.

      Interviewer: Problem?

      Stroustrup: Yes, problem. Remember when everyone wrote Cobol?

      Interviewer: Of course, I did too

      Stroustrup: Well, in the beginning, these guys were like demi-gods. Their salaries were high, and they were treated like royalty.

      Interviewer: Those were the days, eh?

      Stroustrup: Right. So what happened? IBM got sick of it, and invested millions in training programmers, till they were a dime a dozen.

      Interviewer: That's why I got out. Salaries dropped within a year, to the point where being a journalist actually paid better.

      Stroustrup: Exactly. Well, the same happened with 'C' programmers.

      Interviewer: I see, but what's the point?

      Stroustrup: Well, one day, when I was sitting in my office, I thought of this little scheme, which would redress the balance a little. I thought 'I wonder what would happen, if there were a language so complicated, so difficult to learn, that nobody would ever be able to swamp the market with programmers? Actually, I got some of the ideas from X10, you know, X windows. That was such a bitch of a graphics system, that it only just ran on those Sun 3/60 things. They had all the ingredients for what I wanted. A really diculously complex syntax, obscure functions, and pseudo-OO structure. Even now, nobody writes raw X-windows code. Motif is the only way to go if you want to retain your sanity.

      Interviewer: You're kidding...?

      Stroustrup: Not a bit of it. In fact, there was another problem. Unix was written in 'C', which meant that any 'C' programmer could very easily become a systems programmer. Remember what a mainframe systems programmer used to earn?

      Interviewer: You bet I do, that's what I used to do.

      Stroustrup: OK, so this new language had to divorce itself from Unix, by hiding all the system calls that bound the two together so nicely. This would enable guys who only knew about DOS to earn a decent living too.

      Interviewer: I don't believe you said that...

      Stroustrup: Well, it's been long enough, now, and I believe most people have figured out for themselves that C++ is a waste of time but, I must say, it's taken them a lot longer than I thought it would.

      Interviewer: So how exactly did you do it?

      Stroustrup: It was only supposed to be a joke, I never thought people would take the book seriously. Anyone with half a brain can see that object-oriented programming is counter-intuitive, illogical and inefficient.

      Interviewer: What?

      Stroustrup: And as for 're-useable code' - when did you ever hear of a company re-using its code?

      Interviewer: Well, never, actually, but...

      Stroustrup: There you are then. Mind you, a few tried, in the early days. There was this Oregon company - Mentor Graphics, I think they were called - really caught a cold trying to rewrite everything in C++ in about '90 or '91. I felt sorry for them really, but I thought people would learn from their mistakes.

      Interviewer: Obviously, they didn't?

      Stroustrup: Not in the slightest. Trouble is, most companies hush-up all their major blunders, and explaining a $30 million loss to the shareholders would have been difficult. Give them their due, though, they made it work in the end.

      Interviewer: They did? Well, there you are then, it proves O-O works.

      Stroustrup: Well, almost. The executable was so huge, it took five minutes to load, on an HP workstation, with 128MB of RAM. Then it ran like treacle. Actually, I thought this would be a majo
  • At least we won't get any "RTFA, moron!" comments in this article.

    But seriously, I like slashdot because, unlike digg, we get ARTICLES, not videos. I'm not watching this. In protest, here's a completely misinformed and irrelevant comment which extrapolates a lot of very outlandish conclusions from the article summary:

    Stoustrup just wants to make sure VC++ doesn't eat into the market share of his new linux-powered RC car, CTTOX. He has been embracing and extending C ofr many years now; if congress weren'

  • by Anonymous Coward on Monday August 13, 2007 @06:19AM (#20210343)
    The future of BASIC has been envisioned as a language to do more and more intricate beeping loops in high school classes.
  • by tygerstripes ( 832644 ) on Monday August 13, 2007 @06:24AM (#20210357)
    Great - I've been hearing a lot about C-Pound [worsethanfailure.com].
    • by nagora ( 177841 )
      Great - I've been hearing a lot about C-Pound.

      Do you mean C-hashed?

    • Re: (Score:2, Insightful)

      by netpixie ( 155816 )
      That's a weird article.

      Why is this candidate "bad" because he interprets a piece of marketing twaddle (i.e. the name of C#) in a different way from Bill?

      Round here we (mostly) purposefully call things the wrong name, usually as an exclusive in-joke because we all really know what the real term is meant to be. This includes Giga- pronounced "jigga-" and internet called "interweb" or "interwebnets". My favourite is referring to C# as "coctothorpe" as the proper name for the # symbol is octothorpe. I also used
      • Re: (Score:3, Interesting)

        by nwbvt ( 768631 )
        Well for starters, your pet name for a programming language is not something you should continuously use while in a job interview. Basically what it tells the interviewer is that you really have very little experience with it, and probably have never heard it spoken before.
      • No, but refering to C Sharp in front of him, and he telling he really prefers C-Pound could make a clue.
              Would you say, when asked about C-Sharp in an intervew: "Well, if you're going to talk about the language I'll just write with if I want to be comfortable, it's coctothorpe."
  • by Anonymous Coward on Monday August 13, 2007 @06:26AM (#20210373)
    Please use the torrents, and keep those torrent up and running after you're done d/l'ing.

    http://csclub.uwaterloo.ca/files/stroustrup.ogg.to rrent [uwaterloo.ca] Ogg/Theora (Recommended)
    http://csclub.uwaterloo.ca/files/stroustrup.avi.to rrent [uwaterloo.ca] XviD
    http://csclub.uwaterloo.ca/files/stroustrup.mp4.to rrent [uwaterloo.ca] MP4
    http://csclub.uwaterloo.ca/files/stroustrup.mpg.to rrent [uwaterloo.ca] MPEG

    AC to prevent karma whoring.
  • by PhrostyMcByte ( 589271 ) <phrosty@gmail.com> on Monday August 13, 2007 @06:27AM (#20210377) Homepage
    Is that they have given 95% of the development time toward managed languages.

    If you look at the new Visual Studio 2008 - in the three years since 2005 was released, what does Orcas have for C/C++? Still no C99, with open admission that there are no plans to support it. No TR1 for C++. No significant compiler changes. Intellisense is still slow and quite easily stops working all together. Still no assembly support in the 64-bit compiler, missing intrinsic functions for important instructions such as CMPXCHG16B.

    What we get is a newer bundled Windows SDK (which you can download NOW), updated MFC libraries (yuck), and a few new options for Vista compatibility.

    In three years, .NET has advanced from 2.0 to 3.5 with huge changes like WPF, WCF, LINQ, etc. They have all but forgotten C++.
    • Hmmm... Those tactics don't sound familiar at all. Definitley nothing Microsoft's ever done *coughNetscapecough*
    • by mwvdlee ( 775178 )
      Despite Mono's best efforts, .NET is still largely a Windows lock-in feature.
      Now why would Microsoft abandon alternatives to that?
    • Parent is trolling (Score:4, Informative)

      by Interfacer ( 560564 ) on Monday August 13, 2007 @06:52AM (#20210513)
      C99 is driven by customer demand. And I don't mean as in a bunch of geeks saying 'implement ALL of C99 now!' but as in they work with their enterprise customers to prioritize features.

      TR1 WILL be supported as soon as C++0x is finalized. Not sooner. If they would implement is now, it would likely change as soon as the new standard is ratified. Of course, even if they would implement now, you would criticise them as soon as the standard is ratified because ZOMG! Microsoft's TR1 is proprietary and out of date! LOLOLOLROFLMAO!
      I suspect they will simply license TR1 from dinkumware which is feature complete with the current state of TR1.

      Intellisense is a dog. People are working on it, and a lot of redesign is going on. Not just for intellisense, but for the whole compiler architecture to make it more scalable and plufable.

      And I don't know where you are getting your info from, but asm is perfectly supported in 64 bit. Just inline assembly isn't because for 64 bit code this would make it non-portable between different 64 bit architectures.
      You can still add asm files to your VC++ project and compile them.

      And you can say yuck to MFC and I would agree. But a very large number of enterprise businesses still builds massive VC++ applications that use it extensively. maintaining and improving it makes lots of business sense.

      And finally, C++ is not meant to be as RAD as C# and VB because that would require a lot of manpower which cannot be justified. VC++ is targeted for interoperability, performance and control over the program execution. Not for whipping up a data driven LINQ doc. People who want to use LINQ would simply build a C# project for data interaction and add it to their mixed mode C++ project.
      • by PhrostyMcByte ( 589271 ) <phrosty@gmail.com> on Monday August 13, 2007 @07:09AM (#20210609) Homepage
        These are complaints, not trolls. I develop primarily in C++ and am ecstatic about C++0x, and dread seeing my favorite IDE/compiler get put on the backburner and not implement modern unmanaged programming. I don't want to wait 10 years to see C++0x and TR1. They could have easily included Dinkumware's TR1 implementation with it, even in a seperate tr1 namespace, and be sure - everyone would be much much happier.

        C++ was not meant to be RAD like C#, but VC++'s compiler and IDE are _far_ from perfect. There are still several annoying little issues you come across when you play with real C++. My point was that there is so much room for improvement in the C++ compiler but they have completely neglected it and the IDE to implement features for their proprietary languages. Which all in all, this being Microsoft, is not that surprising - but it is still a shame.

        You got one thing right - I did mean inline assembly (sorry, typos happen). It would be just as non-portable as using seperate .asm files - the functionality was there in the x86 compiler, am I to assume they completely rewrote the compiler enough that it would take vast effort to enable this basic functionality for x64?
      • Re: (Score:3, Interesting)

        by MORB ( 793798 )
        Bullshit. They could (should) start implementing TR1 and even parts of C++0x right now so that they can have a fully compliant implementation shortly after the standard is officially released. That's what gcc is doing. It also helps the stadndardization process because they can see whether the current draft has serious issues and fix them.
        gcc has a TR1 implementation and they have started implementing some of the c++0x features (that should be enabled explicitely on the command line)

        In any case, VC++ majorl
    • by Jugalator ( 259273 ) on Monday August 13, 2007 @07:34AM (#20210729) Journal
      This discussion came up again with Visual Studio 2008 "Orcas" and plans seemingly a bit lacking once again for an improved C++ feature set and general love for IntelliSense, etc.

      Microsoft had the following to say:
      http://forums.microsoft.com/MSDN/ShowPost.aspx?Pos tID=970938&SiteID=1 [microsoft.com]

      See bdunlap's response.
      • Forgot one thing. Although the topic is on C++/CLI (formerly called "Managed C++"), I'm not being stupid and confusing it with native C++, but the MS rep is actually saying a few things on their futre "native vs managed" strategy. In essence, they've listened and hear the demand. Not much to come for Orcas, but more in store for the version after.
    • Re: (Score:3, Informative)

      by rbanffy ( 584143 )
      It's clear that Microsoft is not interested in the future of C++.

      They more or less own the market for C# and IDEs for .NET. Why would they still be interested in something that could be used to migrate away from Windows?

      BTW, it's really hard to migrate a Windows C++ program away from Windows. A Windows C++ program may be legal C++, but is something horridly deformed and barely recognizable.
    • by Anonymous Brave Guy ( 457657 ) on Monday August 13, 2007 @07:45AM (#20210825)

      If you look at the new Visual Studio 2008 - in the three years since 2005 was released, what does Orcas have for C/C++?

      I'll see you VC++ 2008 and raise you VC++ .Net (aka VC++ 7.0, aka the 2002 release).

      The sad thing is, from a pure C++ programmer's point of view, a lot of people still regard VC++ 6 as the peak. Sure, the standards compliance is better now, and that's a real improvement. Sure, there have been a few optimisation improvements, and those are worthwhile (when they don't introduce bugs). Sure, the debugger has better visualisation support (autoexp.dat) even for native code, and that's definitely useful (if only they'd document it properly).

      But when they moved to .Net for everything, the IDE slowed down horribly, even without the Intellisense/multi-threading mess that they finally fixed in 2005SP1. Certain features (I'm looking at you, browse toolbar) actually disappeared from VC++, for the rather poor reason that they couldn't be supported in all .Net languages. I understand that the whole unified architecture thing makes sense from a development perspective at Microsoft, but the bottom line is that users don't care, and removing useful functionality is bad. I also appreciate that, several versions later, we now have most of the same basic functionality back again, but it's still a mess compared to the simple, effective browse toolbar. Similar comments apply to various being-too-clever changes to Intellisense, incidentally.

      Perhaps more seriously, as great as all these new optimisations are, we've found far more compiler bugs recently than we ever used to. We write serious mathematical libraries at work, and I promise you it is not fun to spend several days tracking down a bizarre floating point problem, because it turned out that the global optimiser got it wrong fifteen functions up the call stack and now the FPU stack is overflowing.

      Meanwhile, we get to see Microsoft putting lots of goodies in for .Net developers. I'm sure they'd love us all to develop for .Net, but until they support it on seven different platforms (where all versions of "Windows" are grouped together as just one of those), it's never going to be of much interest to us.

      Right now, Visual C++ is still (in my personal opinion) the best C++ compiler/IDE combination available today. But things move fast in software. Code compiled with g++ has lagged in performance for a long time, but if the recent work behind the scenes on things like SSA bears fruit, that performance gap could close very fast. Eclipse/CDT is so clunky as to be almost unusable for C++ development right now (don't flame me, it's just a personal opinion) but I check every now and then to see how things are going and it sounds like someone might be planning a big clean-up so it doesn't feel like C++ forced into a Java-friendly IDE any more. With Microsoft pushing all their funky new UI support into things like WPF that almost no-one uses, and portable GUI toolkits like wxWidgets and Qt becoming better all the time, it's not like having MFC support is a great bonus for new developments anyway.

      In other words, if VC++ 2008 doesn't deliver real improvements for non-.Net-only C++ developers, it's entirely possible that the serious players will be switching to genuinely better open source alternatives for new developments well before the next version of VC++ is out. And that should scare Microsoft, because the superiority of VC++ and the ease of use of VB are the reason so many people have been making effectively Windows-only software for so long.

    • Re: (Score:3, Insightful)

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

      Not that I have anything against C or C++, but for applications (i.e. anything made by Visual C++) I don't think it's an ideal language. We've (as an industry) wasted too
    • Re: (Score:3, Informative)

      by spectrokid ( 660550 )

      intrinsic functions for important instructions such as CMPXCHG16B

      You know you have a sucky language when your important function is called CMPXCHG16B (not to be mistaken with that other little SOB, the good ole CMPCHXG16B)
      • Re: (Score:3, Funny)

        by Bluesman ( 104513 )
        Yeah, what's with all these weird functions like CMPXCHG, XOR, MOVS, and PUSH?

        That Windows C++ stuff, boy, it sure is weird!

  • Please implement delegates and get rid of the method pointers.

    Thank you.
    • Re: (Score:3, Informative)

      C++ has adopted Boost's function class in the TR1 library - you will be able to use std::function, etc. No more member function pointers if you don't want them.
    • by mwvdlee ( 775178 )
      I'd like the Java "interface" mechanism in C++. It's pretty much the only thing that the Java syntax does better than C++ IMHO.
      That and a standardized, platform-independant networking library.
      • Re: (Score:3, Informative)

        by Pr0xY ( 526811 )
        you can easily get the same effect as the java "interface" mechanism bu supplying a class which contains only pure virtuals (and a virtual destructor). For example:

        class AnimalInterface {
        public:
        virtual ~AnimalInterface() {}
        // note the = 0; on the next lines, that means "pure virtual"
        // pure virtual means "no implementation here, a child class must implement
        virtual void eat() = 0;
        virtual void poop() = 0;
        };

        class Monkey : public AnimalInterface {
        public:

        • by mwvdlee ( 775178 )
          The main benefit of Java interfaces is that you can have a single class implement multiple interfaces without having to resort to something like C++'s multiple inheritance. So the Monkey class can also implement HairyInterface, EvilInterface and SlingInterface.
          • Re: (Score:2, Interesting)

            by smellotron ( 1039250 )

            The main benefit of Java interfaces is that you can have a single class implement multiple interfaces without having to resort to something like C++'s multiple inheritance. So the Monkey class can also implement HairyInterface, EvilInterface and SlingInterface.

            The main benefit of C++ abstract classes is that you can have a single class inherit from multiple abstract classes without having to resort to something like Java's interfaces.

            You think multiply inheriting from a bunch of C++ abstract classe

            • by mwvdlee ( 775178 )
              I was just thinking that as the submit button did it's job :)
              Still though, it would be nice to have a mechanism that can't be easily abused, but I guess my main concern has been taken care of :)
  • by 2Bits ( 167227 )
    to Stroustrup, but don't you think it's a bit ironic that the creator of such a monstrosity is talking about ideal of programming languages? And don't even get me into the the differences between implementations!

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

    • Re: (Score:3, Informative)

      by ardor ( 673957 )
      C++ is far too complex yes. But there is nothing that can really replace it. A language which supports functional, generic, procedural, object-oriented programming, with static typing, metaprogramming, and heavily geared towards native building? I mean, do you know a language which can resolve iterators to simple pointer arithmetic when compiling? Of course there are far better languages feature-wise, but they all demand some performance penalties. This may or may not be relevant. For example, for video cod
      • Of course there are far better languages feature-wise, but they all demand some performance penalties

        Pure OO C++ code I have seen, generated direct from UML, performs hopelessly against a C equivalent because of its reliance on memory allocation.

        • Why are you using code generation tools to write code that is performance sensitive? Of course you avoid indirection at all costs in code that has to be fast. It would have been equally as slow if you had used pure OO code in C.
      • Re: (Score:3, Interesting)

        C++ isn't just "too complex". It's "so overly complex that it becomes a real problem." From The Art Of Unix Programming [faqs.org]: "Compactness is the property that a design can fit inside a human being's head. A good practical test for compactness is this: Does an experienced user normally need a manual? If not, then the design (or at least the subset of it that covers normal use) is compact... C++ is anti-compact -- the language's designer has admitted that he doesn't expect any one programmer to ever understand it
      • Replacing C++? (Score:5, Interesting)

        by Anonymous Brave Guy ( 457657 ) on Monday August 13, 2007 @08:14AM (#20211079)

        C++ is far too complex yes. But there is nothing that can really replace it. A language which supports functional, generic, procedural, object-oriented programming, with static typing, metaprogramming, and heavily geared towards native building?

        The thing is, most development projects that use C++ today don't need all of that.

        C++ is a fine, pragmatic tool, and I have great admiration for Stroustrup's ability to build such a useful thing. C++ is also a powerful systems programming tool.

        But C++ is not a good language for most application development, which is what a great deal of code written in it really is. I think there are several separate but somewhat related reasons for this.

        One is the safety argument. Most people simply don't need the flexibility/footshootability [delete as applicable] of C++. You need only look at the much-hyped field of garbage collection to see that (a) many professional developers find this one feature useful that they regard Java as superior to C++ for this reason alone, (b) many more professional developers have no clue about the overheads involved (which are almost zero for typical applications using modern approaches to GC implementation), and most importantly (c) a great many developers using languages without GC make mistakes that developers using languages with GC wouldn't. Similar arguments apply to other routine problems, such as pointers/NULL.

        The second is the expressive power argument. Life is too short to be using programming languages with primitive, error-prone control flow constructs, functions that aren't first-order entities, no syntactic support for common data structures, crude macros, header files, etc.

        Third we have the standard library argument. Yes, yes, you can get a C++ library for almost anything. That's not the point. The key word is "standard". Take a look at the huge practical success of Java and Perl, and tell me the vast Java standard library and CPAN have nothing to do with them. Sure, C++'s standard library is, technically, of a higher quality than most. But it still has stupid flaws (string support and IO streams are both fundamentally broken, for example). More seriously, it has stupid gaps. In the 21st century, it's hard to seriously advocate application development in a language with no standardised support for user interfaces, networking, concurrency, file systems, etc. No, I'm not going to spend days trying to find the right non-standard library for me. Non-standard libraries are for solving significant problems, where the difficulty and scope make it worth investing the time to find and hook in someone else's code. They're not for trivia that everyone uses all the time.

        And finally, we have the tools argument. Working with header files sucks, and while just about everyone else is playing with their funky, auto-refactoring, navigation supporting editors, what do we have? VC++ (where refactoring still isn't available in native C++) and Eclipse (which is C++ forced into a Java-like IDE)?

        The really scary thing is that reality bites now. It's not like I'm the first person to identify these practical flaws with using C++ for application development. It's not like other people haven't developed languages and tools with all these improvements already. And yet C++ continues to be one of the most important application programming languages today. Why?

        Momentum. That's why. Building a new programming language with a syntax that doesn't look like C is asking for trouble; just look at the arguments Python sees over whitespace. (Curiously, I've never seen such complaints made about Haskell. Perhaps this shows a difference between the insight of your average professional programmer vs. your average language geek academic?) More to the point, trying to advocate a new programming language for industrial application development that isn't some form of block-structured, OO-based clone is asking for trouble.

        I'm hopeful that over the next few years, as hardwar

  • and let the syntax criticizing begin ;)
  • not bad... (Score:5, Interesting)

    by rgravina ( 520410 ) on Monday August 13, 2007 @07:28AM (#20210697)
    Recently, I've just started getting into C++, and I can't understand why so many people hate the language with such a passion. The thing is, if you need/want to write your program in a compiled language with plenty of library support, then aside from C, what options are there? I'm not trying to start a flamewar, but I figure if I want to say use C (or other C++) libraries and a compiled language then I feel C++ is much better option than C. One very smart and experienced C programmer I know hates C++ with a passion complaining that "it's too complex" and just rejecting it outright.

    I haven't yet written (or debugged) any large programs in C++, so that could be why I'm still enthusastic. Perhaps after some time with the language I might see what everyone is so worked up about.

    I'm reading through "Effective C++" by Scott Meyers, and although the language seems like it has its warts and complexity, it also offers a great deal of power and is a hell of a lot more fun to program in than C because you get the abstraction support of objects, namespaces etc. Streams - awsome. Shared (reference counting) pointers - awsome. Less need for the preprocessor - awsome. And the standard library (plus Boost too) is so vast... containers, algorithms, it's all there.

    Python is still my favourite general-purpose language, but if I need something compiled, then I don't see what is so bad about C++. Sure, Objective-C is a far better approach to the "lets-make-a-better-C" idea, but I'm not sure how to use it (and the standard library) outside of OSX or GNUStep.
    • Re: (Score:2, Insightful)

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

      The problem is that there are so many ways to do things wrong in C++. Writing proper code takes experience. It doesn't help either that monsters like MFC easily mess things up.

      I was going to quit coding C++ when I discovered Boost [boost.org] and wxWidgets [wxwidgets.org]. Now I don't want use anything else.

  • Watch the video (Score:3, Interesting)

    by dysfunct ( 940221 ) * on Monday August 13, 2007 @07:35AM (#20210743)
    As an autodidact I'm easily bored by overly long and dry technical presentations of what could be read through in a couple of minutes, but this video is getting very interesting and funny after the first couple if minutes. Lots of insight into the process of creating the new standards and and all the thoughts that go into it, mixed with anecdotes, random trivia and geek humor by Bjarne Stroustrup himself. I'm actually considering downloading the 700mb xvid version of the talk and making me some popcorn to go with it. IMO, even if you're not a C++ geek it's actually worth watching.
  • And it looks something like Haskell. Static typing, lazy evaluation, high-level parallelism, pure functionality, explicit imperative-ness. Heck, monads even sound like something from the future.
  • by Futurepower(R) ( 558542 ) on Monday August 13, 2007 @07:51AM (#20210897) Homepage
    Dr. Stroustrup [wikipedia.org] made a great contribution by designing the C++ language. However, in recent years it seems to me that he has been taking a leisurely approach to making improvements.

    Stroustrup is, unlike most programmers, an excellent writer. His FAQ [att.com] is an example. Quote: "What's a good certification for C++ programmers? To the best of my knowledge, there isn't a good certification program for C++ programmers. That's a pity. A good certification program would be most useful. However, C++ lacks the central organization that would produce a solid certification program, and a certification program without authority or that focused on syntax would be worse than useless."

    I'm certainly not an expert in this subject. However, I get the same impression from the words "C++ lacks the central organization" in that paragraph that I get from his other recent work. Something like, "What, me be a leader?"

    Note that Java and C#, which are sometimes seen as replacements for C++, are proprietary languages from companies that are routinely mismanaged. If you use those languages, you partner with those companies, and it is possible that you too will suffer from their mismanagement. For that reason, there is a big need for strong leadership in maintaining a language unencumbered by issues of proprietary behavior.

    Concerning Java, Dr. Stroustrup says [att.com] "Java isn't platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. That is, you can write programs for Windows/Intel or Java/JVM, and in each case you are writing code for a platform owned by a single corporation and tweaked for the commercial benefit of that corporation."

    Concerning C#, he says [att.com], "It will take a lot to persuade me that the world needs yet another proprietary language (YAPL). It will be especially hard to persuade me that it needs a language that is closely integrated with a specific proprietary operating system."

    Again, I'm not an expert in this area, but it seems to me that Dr. Stroustrup tends to define his leadership narrowly and concern himself with programming constructs rather than larger issues such as extension, standardization, and certification of libraries, for example. About C++ garbage collection he says, partly: "See ... Hans-J. Boehm's site [att.com]". It seems to me that there are too many areas in which the C++ answer is "You can just go there", rather than "This is the standard, certified method."

    It's amazing to me, but true leaders are very rare. After all these years, we still depend on Dr. Stroustrup, even though he has been less than a complete leader in the more social aspects of developing the C++ language, in my opinion.
    • Re: (Score:3, Insightful)

      by canuck57 ( 662392 )

      Again, I'm not an expert in this area, but it seems to me that Dr. Stroustrup tends to define his leadership narrowly and concern himself with programming constructs rather than larger issues such as extension, standardization, and certification of libraries, for example. About C++ garbage collection he says, partly: "See ... Hans-J. Boehm's site [att.com]". It seems to me that there are too many areas in which the C++ answer is "You can just go there", rather than "This is the standard, certified method."

    • by roman_mir ( 125474 ) on Monday August 13, 2007 @09:08AM (#20211603) Homepage Journal
      Concerning Java, Dr. Stroustrup says "Java isn't platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. That is, you can write programs for Windows/Intel or Java/JVM, and in each case you are writing code for a platform owned by a single corporation and tweaked for the commercial benefit of that corporation." - shouldn't this count for a Flamebait at this point, that Java is Free Sourced?
  • by theendlessnow ( 516149 ) * on Monday August 13, 2007 @09:52AM (#20212129)
    I tried to post a comment on this story, but was unable to upload my video response.
    (sigh)
  • give it a rest (Score:3, Insightful)

    by m2943 ( 1140797 ) on Monday August 13, 2007 @10:55AM (#20212909)
    C++ is my main development language right now, but I have to say: please give it a rest. C++ is what it is, and I don't think adding even more crap to it is going to make it any better.

    What we need is a language with C++-like performance characteristics and a C-like syntax that will feel familiar to C/C++ programmers but without all the baggage of 30+ years of C history.

    (And, no, neither Java nor C# are that language.)
  • by Anonymous Coward on Monday August 13, 2007 @11:17AM (#20213179)
    a new language like D and not just an improved C++.

    As a C++ programmer, I can tell you that it is nearly impossible for C++ to make coding, compiling and debugging easier without redesigning the language.

    Coding: Name one C++ editor or IDE that offers accurate code completion or code refactoring (compared to other languages.) I've tried Source Insight, SlickEdit 2007, Visual Studio 2005, Understand for C++, Vim, etc. and it is clear C++ is too complex compared to most other mainstream programming languages.

    Compiling: Implementing a C++ compiler is far too difficult. And compiling takes too long even when you use C++ idioms like pimpl.

    Debugging: Sure, boost.org's smartpointers and RAII are helpful but how many hours do C++ programmers spend tracking down bugs that would've taken minutes (if not seconds) to track down or avoid in other programming languages?

    Why do I use C++? Because it is compiled, has numerous 3rd-party libraries, and is widely used. Like Windows XP, it might be a pain but it is so widely used that you'll have no problems finding employers that will pay you to use it.

    Simply put, we deserve something better than C++ and it isn't going to be enough to enhance C++ because a full redesign is needed in order to address the issues noted above. We need and deserve a language that takes what we've learned from C++ and is designed from the ground up to address those issues.

    So far, D programming language seems to offer the best hope, and some really talented C++ gurus like Walter Bright and Andrei Alexandrescu are involved.
  • by Anonymous Coward on Monday August 13, 2007 @11:19AM (#20213201)

    C++ has many problems. Some, like "an array is a pointer", it inherited from C. Some were mistakes in the original design that were later fixed, like unchecked downcasts, "this" as a pointer rather than a reference, and the lack of generics. And some are there because Strostrup is in denial about the problems, like the fact that the language gives no help with either thread or memory management.

    Memory management remains the biggest problem. The fundamental problem is that C and C++ require the programmer to obsess on who owns what, while providing zero assistance in managing that information.There are ways out of this, involving syntax and compiler support for owning and non-owning pointers. But instead, attempts have been made to paper over the problem with templates. This never quite works, because for some things you still need a raw pointer, which breaks the abstraction. The history of auto_ptr (up to standard revision #4 now, I think) makes this clear.

    Bolting on a garbage collector doesn't help much in a language with destructors; see the mess in Microsoft's "managed C++". If you're going to go with a garbage collected approach, it's better to go to a language designed for it, like Java.

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

    Incidentally, none of this has anything to do with C++ being compiled directly to machine code. There have been safer compilable languages usable for system-level programming. Modula 3 was probably as good as it got. But that language died when DEC went under. It's possible to hard-compile Java; there's a version of GCC for that, and it's getting some interest in the embedded community. The problem could be fixed. But it won't be, because the people responsible are in denial.

    • Re: (Score:3, Insightful)

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

      No thread management : this is an OS-s
    • Re: (Score:3, Insightful)

      by Cassini2 ( 956052 )

      IMHO, I think:
      a) If you want garbage collection, you have to leave C++ and go to a truly safe language like Java or one of the .NET languages. You can't have the ability to do whatever you want to a variable, and the ability to be safe from it simultaneously.
      b) If you are trying to code a GUI application with cool RAD development tools (like VisualBasic and Eclipse), then C++ is the wrong language. It was never built to be quick and easy for the programmer. Additionally, the windows based object-orient

    • Re: (Score:3, Insightful)

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

      Obviously, you never used modern C++ extensively.

      Templates are not a ma
  • null keyword rant (Score:3, Insightful)

    by wiredlogic ( 135348 ) on Monday August 13, 2007 @11:59AM (#20213677)
    Could it really have been that difficult to add a "null" keyword to C++? "bool" was cleanly added to C99. We could have had "null" too. I accept the argument that (void*)() isn't typesafe but then the language expects you to throw around a literal integer "0" that is imbued with magical properties. How is this a cleaner solution? This magic 0 violates the type safety principal that got us into this rathole to begin with since it can be assigned to non-integral types (pointers). It can also transform itself into another value since the null address isn't necessarily 0 on all platforms.
  • by MobyDisk ( 75490 ) on Thursday August 16, 2007 @07:43AM (#20247825) Homepage
    What is odd to me is that I see new stuff written in C all the time for embedded systems, *nix code, drivers, etc. It's odd because C++ is merely language extensions on top of C. There's really no down-side to using C++ at all (queue the thread of trolls telling me how awful OOP is and why C++ forces them to use it). My guess is that the problem is g++: I am currently writing some code for the Nintendo DS, and if I compile it in gcc the code is 100k smaller than when I compile the same thing in g++, even before using the OOP features. I don't know why, but I know other people have reported the same issues. This is perpetuatating the myths that C++ is bloated. Really, we need C++ in a lot of ways but the tools are making it look bad.

"The one charm of marriage is that it makes a life of deception a neccessity." - Oscar Wilde

Working...