Slashdot Mirror


C++ Creator Confident About Its Future

bonch writes "Bjarne Stroustrup is confident about the future of C++. He says there is a backlash against new languages like Java and C#, and that developers are returning to C++." From the article: "He claimed the main reason why people are not aware of this is because C++ doesn't have a 'propaganda campaign.' Sun Microsystems has touted the use of Java in the Mars Rover program, for example, but Stroustrup asserts that C++ was also used.

41 of 241 comments (clear)

  1. C++ Should Be The Only Programming Language by rqqrtnb · · Score: 4, Funny
    Today's Software and IT industries are plagued by programming errors. While some of these errors are the result of illegal use of non-Microsoft software on rogue networks, the majority of problems stem from difficulties in mingling code of different programming languages. Standarization on the best-of-breed programming language, C++, would undoubtedly reduce errors in software.

    In this article, I seek to dispel the myth that non-C++ languages are beneficial in proper Software Engineering. I outline how standardization on the C++ language can strengthen your corporation's bottom line. And I describe how to contact the men in Congress to have C++ use finally made legally mandatory.

    C++, a programming language invented by Lucent's Bjarney Strupstrup in 1995, has been hailed as a God-send to Computer Science since its creation. Based on Richie Kerninghan's language "C+", C++ brought several previously-theoretical programming languages features to the mainstream:

    Church-Rosser Compliance
    Known as "multiple inheritance" in the programming world and as "being Church-Rosser" in academia, C++'s compliance to this IEEE standard immediately placed it head-and-shoulders above other languages. "Churrossity" allows programmers to use blocks of code, called "objects," in place of other blocks of code ("arrays".) The layman can think of this as "allowing 'new' code to 'run' old code." This advance has not been possible in previous logic-based languages such as Ada.

    Multi-Byte Characters
    C++ allowed use of "Beaster," a subset of Microsoft's COM ("Common Object Model") windowing layer. The Beaster system allows non-English-speakers such as the Welsh to use computing technology, as it could redirect the signals used to display non-English characters on a computer's monitor screen or laser printer. It is also useful in helping the blind, who speak a specialized subset of English called "ALS."

    Pass-By-Text
    A non-recursive pass-by-text mechanism existed in Kerninghan's C+, called "macro facility." But Strupstrup did Kerninghan one better with the "String Template Loader" variable passing mechanism, which allowed text to be passed to procedures at run-time. This sped up code execution times, as code could be compiled while the user was running the program. This eliminated speed loss caused by incompatibility from obselete computer chips (Motorola and ADM.)

    The superiority of C++ over other languages should be obvious. But is switching to it from other languages possible in your corporation? Astute observers will note that the eco-terrorist group FSF produces a C++ compiler called "DJGPP." Under President Bush's War on Terror, any organization supporting a terrorist organization is recursively itself a terrorist organization.

    Corporations needn't worry. Microsoft has its own C++ offering, "Visual Studio." As an added bonus, Microsoft Visual Studio is highly standards compliant. It features a visual programming interface, and several features not found elsewhere (such as a visual debugger and an AOL instant messanger client called "Windows Messaging".)

    But these advantages can only be realized if code written in inferior languages can be kept from polluting the inter-web eco-space. When compilers for other languages are available, low-level managers are tempted to write code in them. Why? Often times, managers are brought up from the ranks of Software Engineers, and thus lack an Executive's sense for using the right tool for the job. When these managers write code in a jungled zoo of languages, code in one program is unable to interact with code from another program (churrossity.) Only by standardizing on C++ can all programs run together smoothly. Using C++ to eliminate software errors will jump-start the sagging technology industry. This will boost our economy as a whole, which in turn will help us to win the War on Terror.

    The effort to legally mandate this has been going on for a while. But it needs your

  2. creator of the C++ programming language by Atrax · · Score: 2, Interesting

    Creator?

    OK, mod me troll, but surely C++ is by definition an 'extension' of C?

    So, creator is a big word. Or perhaps the lack of context is the problem? Or maybe I'm just a language nazi?

    mod me pedant....

    --
    Screw you all! I'm off to the pub
    1. Re: creator of the C++ programming language by Slow+Smurf · · Score: 2, Insightful

      It went from a non object oriented language to an object oriented one, seems like creating to me.

      (though yes, you can of course use OO in C, it just sucks)

    2. Re: creator of the C++ programming language by jhoger · · Score: 2, Funny

      Using OO sucks in C++

      At least in C your bugs are all yours.

      -- John.

    3. Re: creator of the C++ programming language by david.given · · Score: 2, Funny
      At least in C your bugs are all yours.

      All These Bugs Are Yours --- Except .net. Attempt No Coding There.

      *cough* sorry.

  3. While it would be nice... by 0x461FAB0BD7D2 · · Score: 4, Insightful

    it seems that with corporate support, Java and .NET technologies, as well as Perl, PHP and Python are the major languages for the future, not C++.

    Apart from PHP and Perl, the above languages are usually very strict in their object-oriented ways, and thus prevent loose syntax and clumsy errors. But this nannying produces only poorer developers who rely on the language rather than their own abilities to code effectively.

    A return to C++ would be nice, especially in educational institutions, as it provides all the necessities of modern languages, bar effective string-handling, while maintaining the simplicity of older languages.

    While Java and .NET may be the future for enterprise software, developers should learn C/C++ first, and not Java, as those who can program effectively in C and/or C++ tend to code better in Java and .NET, while the reverse is not true.

    1. Re:While it would be nice... by FidelCatsro · · Score: 2, Insightful

      You dont hammer a nail with a screwdriver , and you dont program an OS in Java.
      C++ fills a rather difrent void and there is place for all , it really depends what you want. Right tool for the job as always applys

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    2. Re:While it would be nice... by Chris_Jefferson · · Score: 3, Insightful
      bar effective string-handling

      out of interest, what's wrong with std::string?

      --
      Combination - fun iPhone puzzling
    3. Re:While it would be nice... by the+eric+conspiracy · · Score: 3, Insightful

      A return to C++ would be nice, especially in educational institutions, as it provides all the necessities of modern languages, bar effective string-handling, while maintaining the simplicity of older languages.

      . You may complain about Java etc. being inefficient or coddling developers, but the design of C++ is strictly a case of bolting object orientation onto a procedural language in a very crude manner, then throwing in the kitchen sink just so that it has feature xyz. It collapses of it's own weight. C was/is fine with it's minimalist approach and economy of expression. Java and other GC languages have thei place because by handling GC they markedly improve programmer productivity.

      But C++ is an abomination - a siamese twin floor wax/desert topping that should have been seperated into C and a real OO language years ago. I can't imagine why it survives at all. It is like one of those Cadillacs from the 60's with the giant tail fins and 400 pounds of chrome, and no consistency of design. It is so bad that it took a decade just to get compilers that worked properly - and from what I've seen there are still a lot of C++ compilers out there that fail to completely implement the language.

    4. Re:While it would be nice... by Lally+Singh · · Score: 4, Insightful

      It's an actual C++ feature. 90% of the people on this site that say they know C++ know C with classes.

      --
      Care about electronic freedom? Consider donating to the EFF!
    5. Re:While it would be nice... by mobydobius · · Score: 4, Informative

      if you really are interested in c++ regex, you should get to know Boost. It is a fantastic set of libraries that play nice with the standard c++ library, and includes regexes, parser generators, threads, algebra and probability packages, serialization, custom memory handling, and more.

      --

      "I like to wear big boy pants."
    6. Re:While it would be nice... by aCapitalist · · Score: 2, Insightful

      ..., and you dont program an OS in Java.
      C++ fills a rather difrent void and there is place for all


      How many operating systems are coded in C++? I know a lot that have been coded in C, but none that have been coded in C++.

    7. Re:While it would be nice... by UnknownSoldier · · Score: 2, Interesting

      > BeOS was written in C++

      The kernel wasn't, but all the 'Kits' above it was.

  4. Look! A funny. by tb3 · · Score: 5, Funny

    "...Stroustrup asserts that C++ was also used.
    I bet he also trys to catch all the code NASA uses.

    --

    www.lucernesys.comHorizon: Calendar-based personal finance

  5. C++: too complex by Anonymous Coward · · Score: 3, Insightful

    I never saw the point of C++.

    I've been programming a while. Familiar with Lisp, Smalltalk, etc. My first "favorite" language was C, which had a certain simplicity that appealed to me. I also liked Objective C.

    When I first saw C++ it seemed complicated and half-baked. Objective C was SO much nicer. And one C++ program would work with one compiler, but not another. The language was in a state of flux apparently. So I ignored it, thinking it would be finished later.

    By the time I looked at it again, computers were fast enough so that "scripting" languages like Python were practical for big projects, and elegant enough to write good programs in. C++ was still a gigantic clunky mess. I remember seeing those "What's wrong with this program?" ads with C++ examples and being utterly confused. And any language that "mangles" things should be avoided I think. :-)

    Also Java looked like "what C++ should've been".

    And now the programming world seems to be returning to a desire for simplicity, elegance, "Agility", and C++ just doesn't cut it. My favorite language today for practical work is Ruby, with the occasional C extension.

    So, to me, C++ is an obsolete language.

    1. Re:C++: too complex by Anonymous Coward · · Score: 4, Insightful

      You can not match the cleaniness and performance of C++ in regular C. To do the same things you do in C++ in C while maintaining the same performance looks ugly and complex. C just doesn't have enough functionality.

      Ruby is slow even for scripting languages. It's fine for many things, but if you need performance Ruby doesn't cut it. And if you really need performance no scripting can cut it and you gotta use something better.

      Nothing can equal the power along with performance that C++ gives you. It's not perfect and has some serious issues, but it's the best we have in terms of performance combined with power.

  6. C++ has a long future... by DavidNWelton · · Score: 4, Informative

    ...like any language that has had its time in the limelight. There are millions upon millions of lines of code written in it, and a lot of that isn't just going to be rewritten from one day to the next, no matter how much buzz and hype Sun and MS spew forth about their new languages.

    I wrote an article about the economics of programming languages that talks about this and other issues that concern the adoption and lifecycle of languages, although be forewarned that the login system is a bit fiddly:

    http://www.byte.com/documents/s=9553/byt1113845246 791/0418_welton.html

  7. To those who have not programmed in C++ enough... by pauljlucas · · Score: 4, Informative

    ... especially Java zealots, try reading Modern C++ Design by Alexandrescu. It'll blow your mind. Java generics don't even come close.

    --
    If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
  8. Ruby, etc.... by Casandro · · Score: 2, Interesting

    I wonder why people bother with things like C# or Java. They don't seem to offer any big advantages over C++. On the other hand, all I've heared of C++ and all I've seen of it and learned of C basically was horrible. I mean mucking around with pointers is something that can be fun, but it definitely doesn't have the beauty you need for doing real work. However there are alternatives. Just look at Ruby, a completely object-based language. You can do thinks like "Hello World".length, or -113.abs . You do not need to care about creating and destroying objects since everything is done in a really nice way. It is extremely powerfull, enabling you to examine and modify your own program code at runtime. And it's even clean at that. I definitely wouldn't want to start any new projects in C# or Java, but C++ also wouldn't be my first choice.

  9. The reason I don't use it by prash_n_rao · · Score: 3, Interesting

    I program for the PC only as a hobby. At work I use only C and program only embedded systems. My industry is strongly and almost universally prejudiced against C++ as they believe it will result in slow applications.

    The basic reason I don't use C++ is the lack of sensible libraries as part of the standard. A programmer desirous of learning cross platform GUI programming has to rely on libraries that are not a part of the standard. I haven't poked around that field for a while now, but IIRC, each system had its quirks and arcane additions. For example, MFC (not cross platform) and QT have implemented their own version of various containers, string classes, etc. MFC relies heavily on arcane macros, QT relies on a weird (from a pure C++ point of view) MOC. I understand they both had good reasons for doing that when C++ was still evolving. But today, it is just a hinderance when trying to write "clean" code.

    Another disadvantage of not having a great collection of libraries in the standard is that people won't know about them unless they dig around a lot. Introductory text books won't cover them, help files in the system won't cover them (if they do, a beginner in that field might not even know what to look for and where to look).

    Do you want a OO library for accessing the serial port? OK... which OS? Windows: use MFC. Linux: google around until you find something on sourceforge. What about some GUI and audio libraries? again, similar method. Fine... now the application has used various libraries from various places. The source now looks like it was done by a person with multiple personality disorder, with each library having its own design and coding approach. Now that you have built an application with ten different sources of libraries, you have to keep track of all of them for bug-fixes, performance enhancementes. Each with its own quirky impact on your application. I went through all this, and eventually gave up C++ in favour of Java.

    And this is just the beginning of my woes with C++.

    --
    This is not my sig.
    1. Re:The reason I don't use it by Jordy · · Score: 3, Insightful

      You know, you don't have to use a C++ GUI library when writing a C++ application.

      Seems sort of silly to state that C++ doesn't have a good set of libraries when you can use any C library you wish. I do it all the time. There is no reason to create a C++ resolver library when a simple one exists in C already.

      C++ has a very simple philosophy, you don't pay for what you don't use. You can write C and occassionally use std::string if you want to. Nothing stops you from doing it. There is no rule that says, "thou shalt use operator overloading."

      --
      The world is neither black nor white nor good nor evil, only many shades of CowboyNeal.
  10. Ousterhout's Dichotomy by DavidNWelton · · Score: 2

    Ruby is slow even for scripting languages. It's fine for many things, but if you need performance Ruby doesn't cut it. And if you really need performance no scripting can cut it and you gotta use something better.


    The ideal way of doing things is to write as much as you can in the scripting language. This is almost always faster and more efficient in terms of programmer time. Then, you go back and redo the speed critical bits and pieces in C or C++.

    When this dawned on me, I really began to appreciate Tcl a lot more than I had in the past. It's C API lets you do a ton of fun things. Multiple interpreters, stacked channels, all kinds of access to variables and commands. And the original source code is extremely legible should you ever get the urge to hack on it directly.
  11. I've always liked C++ by renehollan · · Score: 5, Insightful
    I've coded in various assembly languages, scripting languages (though I forget Perl as fast as I decide that it's appropriate for some piece of glue and am constant relearning it), C, C++, C#, and yes, even COBOL in the dim past (using COBOL to provide indexed file support to Pascal applications via COMPASS trampolines on an old Cyber 835 running NOS was, well, a scizophrenic programming experience). I tend to like the richness of C++.

    However, it's a double-edged sword. It has been said that C lets you shoot yourself in the foot. C++ provides a dozen ways to shoot yourself in both feet and your own back, simultaneously. Be carefull.

    Many have tried to design languages to protect the programmer from themselves, i.e. by providing native garbage collection, disallowing bald pointers, etc. However, this is short-sighted. It presumes what is "hard" and prevents the skilled programmer from replacing the default implementation. C++ new and delete member functions provide no-fuss custom memory management... and probably account for probably half of those ways of shooting one's self in both feet and back.

    A language that is complete in the sense of permitting the coding of fundemental facilities is seductive. It provides an assurance that one can implement "low-level" stuff like memory management, or even the bulk of an O/S kernel in it. The lack of I/O facilities in C, for example, is an intentional feature, and not an oversight. Never have to learn another language again.

    Other languages may provide the convenience of built-in capabilities that are useful for a particular task at hand: awk, perl, and the rash of modern scripting languages come to mind. When the shoe fits, the adaptable programmer will take the path of least resistance. Languages like Java and C# attempt to bridge the general-purpose languages with the protection and features offered by application-specific ones, the latter via extensive run-time libraries (.NET, anyone?). They tend to return to the pseudo-compiled small-interpreter model to provide hardware portability.

    The problem is, that one has do do things the C# "way", or the .NET "way", or the Java "way". Multiple inheritance? Oooh, it's so hard to implement right, and can be so confusing, and, admitedly can be expensive at run-time, so we'll not provide it. Mixin becomes a hack, with language keyword support. Over time, syntactic sugar in the language provides clever support for things like iterators, but binds language features to what should be artbitrary types (Lists are special in C#, for example).

    Well, I want it all.

    A programming language that will let me shoot myself in the foot any way from Sunday if I dare to try... but, with the flexibility to let me say, "Nope. No bald pointers here." Segregation of programmable expressiveness by program, not language, design.

    A programming language that is mutable, so I can invent my own brand of syntactic sugar, and the support to let me quickly find out what mutations a particular piece of code uses.

    A programming language that lets me choose when to evaluate things. Do I want this figured out at compile time? Link time? Load time? Run time? Sorry, C++ templates, though Turing-complete are about as maintainable as APL, if one uses them for anythng clever.

    It's too bad Mary2 never caught on.

    Many will argue that mutable languages result in unmaintainable code: which mutation is in force? I would counter that programs written in non-mutable languages are equally unmaintainable if one does not understand the design of the application. Sure, one can see the "trees", but not the forest: I know x = a + b adds a and b to yield x, but what is that for? The effort to undestand what mutations are in effect is likely similar to the effort to understand an application's design. Except, one has the advantage of a known meta-syntax for expressing the mutatations, instead of having to rely on a design document (which may not exist), likely poorly written or out of date

    --
    You could've hired me.
  12. Some backlash in academics as well.. by BigZaphod · · Score: 4, Interesting

    When I was in college for my CS degree, the focus shift away from C/C++ and towards Java was beginning. I was lucky in that my early CS programs were still in C++. However, the classes right behind me as I moved through were getting shifted over to Java one by one. I did not like that at all. It just felt wrong. I figured maybe I was just being biased since I learned C/C++ pretty much on my own without the aid of classes.

    After graduating with my BS in CS, I was out in the field for a few years. I spent some time at a C++ Windows shop which was trying to become gung-ho about C# and the various .NET technologies. The magazines all had big pushes for Java, C#, VB.NET, etc.

    I left that place and moved into a contracting position where I help admin a data center. The attitude there is much different, to say the least. :-) Everyday we have to deal with huge bloated Java web applications that melt CPUs, eat RAM, and are so slow it takes boxes with 11 CPUs just to service a few thousand customers. The distaste for Java that begins in our department has been filtering up the layers and is starting to become apparent to some of the people who build these projects. When you line up a huge app in PHP next to one written in Java, why is it that the PHP one can easily outperform it on less hardware and require less people to maintain it? That all translates to big $$$$ not to mention application stability and performance.

    I'm also now studying for a master's degree in CS. Since I had been away a few years, I was not surprised when I came back to see Java everywhere in the undergrad classes (this at a different school than before). What did surprise me is the attitude of one of my new professors. He taught a projects class where the whole point of the class is to build/do something by the end of the term. It doesn't matter what as long as it fit the basic subject area of the class. After that, you're pretty much on your own (or in a group, if you want). Since this was a different school than where I got my BS, I didn't know this professor. I had seen him wearing a Java shirt a few times, so I was prepared to have to deal with some friction when I went to suggest that I wanted to do my project with C++. One day I stayed after class to chat with him and get to know him a bit. I was shocked to discover that he had done a lot of postdoctoral research using Java and about Java and found it lacking in many very important areas (specifically in high performance scientific computing applications). As we were walking out of the building, he was asking me about my background in programming and computers, so I was giving him a mini life story sort of thing. I mentioned my C/C++ upbringing and how in my college days the Java shift had begun and I didn't quite feel comfortable with that and how I see it seemed to have happened everywhere. That's when he took a careful look around the hallway, leaned in, and said in a hushed tone, "Switching to Java for the undergrads is the worst decision this department ever made."

    I was pretty stunned to hear that from a professor considering what was going on just a few years previous. I hope that sentiment grows and CS departments take back their programs from corporate interests and marketing machines. Perhaps there is hope...

    1. Re:Some backlash in academics as well.. by Dixie_Flatline · · Score: 4, Insightful

      I think that moving to Java is a terrible idea in too, but it has a lot more to do with the teaching than the actual language itself.

      Java is a fine language. I've done a lot of cool stuff in Java. Out of the box, it has libraries to handle multithreading and all sorts of neat stuff.

      The problem is that when you don't have to worry about things like memory management, you lose a huge part of your education. You don't think about things in terms of the kind of resources that you might use, you just do it.

      In a way, it may be possible to go to a purer kind of programming with Java, needing only to worry about the algorithmic complexity of the method that you're coding. In practice, however, I've seen nothing but sloppy work out of people trained from the start using Java.

      I coded in at least 6 different languages through my degree, and I did most of my work in C, not C++. I believe that when you start, you should start close to the machine, not as far away from it as possible. Start with assembly - the programs don't have to be big - and work your way up. Java is the last step you should take, after you understand what it's doing under the hood, and how to mitigate the overhead that those sorts of things will incur.

  13. plagiarism by cronian · · Score: 5, Informative

    Isn't this copied from http://www.adequacy.org/public/stories/2002.7.4.18 3710.3582.html?

  14. Id rather by MemoryDragon · · Score: 5, Interesting

    See objective C with GnuStep as base for the next gen C based frameworks and low level languages, than having that monster without decent classlib C++ rising again.

    Sorry, been there, done that, but the widespread usage of C++ was one of the biggest history jokes ever. A language, as bloated as a language could be, with lots of cool features on the language level, but ommitting the two most important aspects, a good standardized classlib which covers all important application scope aspects, and a language which is actually usable without having to fight with it for years before being able to master it to a certain degree. There was a reason why people flooded to java in 97-98, it was less the hype, it was more the fact, that people tried to implement big long running systems in C++ and saw it was not really feasable in a decent timeframe, due to constantly crashing problems thanks to the missing boundary checks, memory leaks thanks to the missing garbage collector, and general programming errors and unreadable code, thanks to the byzantine bloatware the language in fact really is. Add to that the compiler bugs caused by the 1200 pages of language specs and you could see why people were fleeing from C++.

    And up to date, whenever I have to talk about C++ I only can give the advice, limit yourself in the usage of features and only use a readable subset of it (which would be similar to java and C#), try to omit the C heritage entirely if possible, do not use preprocessors, do not use extensive operator overloading or templating. And check out the KDE/Qt API, they so far have been the only ones to master the language on a design level which in fact results in readable and maintainable code.

    1. Re:Id rather by neonstz · · Score: 2, Insightful
      ...a good standardized classlib which covers all important application scope aspects

      Eh. You have no idea what C++ is used for. Programming isn't just writing nice little programs for desktop computers. C++ is used in everything from tiny microcontrollers to large clusters. Good luck writing a classlib which covers that.

      You mention KDE/Qt as examples on APIs that are good. I use Qt at work and I really like it. However, Qt covers just one (or a few) uses of C++, regular applications which run on standard desktop computers/handhelds (or servers), usually with a GUI. Qt would've been no use for me when I used C++ for coding for the Gameboy Advance.

      ... a language which is actually usable without having to fight with it for years before being able to master it to a certain degree

      Yes, mastering C++ is hard. So is mastering Java/C#. I've seen a lot of really crappy C++ code, but I've also seen equally bad java-code. A computer language won't help you write better code. It may not crash and burn like a C/C++ pointer error, but an uncaught exception or excessive object creation in innerloops in java is just as bad.

      (As a side note. Bjarne was talking about the future of C++ last week, and one of the things he addressed was that C++ have become a bit too "expert friendly". They're addressing this in the next C++ standard, but don't expect anything revolutionary.

  15. Re:To those who have not programmed in C++ enough. by the+eric+conspiracy · · Score: 3, Informative

    Here's a question for everyone: Which is better? An expertly designed and elegant C++ program with all the proper abstractions, frameworks, and methodologies that 1% of software developers can comprehend quickly, or a C program with a flat set of files, simple structs, and a few shell scripts to build it, which everyone understands (and can even debug)?

    The simple flat file C program that everyone can debug is also a small program. OO really comes into it's own when you get over 20,000 lines of code. Then the kiss C style starts breaking down.

  16. Re:To those who have not programmed in C++ enough. by SunFan · · Score: 2, Insightful


    With well-organized header files and a little documentation, I've had no problems with C up to 100K lines. The main advantage, IMO, is that C is just so damn simple to "execute" in my mind, and it is very intuitive to step through in a debugger. The only real catch for me is tracking down memory leaks at times.

    Now, for programs with millions of LOC, I don't think any language will be easier than another, just because the program's own complexity overwhelms everything else. Just ask people how quickly they can get up to speed on OO.org, KDE, Mozilla, or GNOME (they all suck for casual developers).

    --
    -- Microsoft is the most expensive commodity operating system and office suite vendor in the marketplace.
  17. Nice troll. by rjh · · Score: 4, Insightful
    It is so bad that it took a decade just to get compilers that worked properly
    The C++ Standard wasn't finalized until 1998. We're seven years out from the Standard, and we've had good compilers for more than a couple of years now. GCC 3.0 is where I draw the line for "good C++ compilers", but Intel and other firms had good C++ compilers for a similarly long time.
    But C++ is an abomination--
    Most C++ enthusiasts, myself included, will agree with you. In some ways, C++ is a lot like Perl. Larry Wall said about Perl, "The language is such a mess because the problem space is such a mess." The same applies to C++.
    I can't imagine why it survives at all.
    If you can't imagine why it survives at all, that strongly suggests you've never bothered to learn why it's survived.
    no consistency of design
    You've clearly never read the C++ standard, where one design goal guides all of the C++ specification: "you don't pay for what you don't use".

    You've also clearly never done serious programming with the Standard Template Library, where the algorithms are written so generically--and so consistently across different data types--that they can be plugged together in an almost limitless number of configurations.
    1. Re:Nice troll. by rjh · · Score: 2, Informative
      The STL has a consistent design, but the base C++ language doesn't.
      The STL is part of the base C++ language. Read the Standard.
      The STL is a decent library
      Damning with faint praise. Have you ever used the STL for more than a trivial 5,000-line app?
      but it was hardly revolutionary. Type-safe generics were not a new technology at the time.
      C++ generics predate Ada95's strong generics mechanism by quite some time. In fact, the inventor of generics--Stepanov--used C++ as his testbed for ideas. C++ generics go back to the early 1980s.
  18. Not an extension by rjh · · Score: 3, Informative

    C++ started out as an extension of C, but the two quickly diverged. C++ is not a superset of C; it's an entirely different language nowadays with a syntax clearly borrowed from C.

    A trivial conversion exists between any ISO C90 program and ISO C++, but then again, we have FORTRAN-to-C translators and nobody thinks C is an extension of FORTRAN.

    Stroustrup would also likely be a little uncomfortable with the appellation "creator". While he's certainly been one of the pivotal figures in C++, Stroustrup has always been quick to recognize the contributions of other people and the work of the ISO standardization committee.

  19. High School's should teach C++ by deian · · Score: 5, Insightful

    I'v been coding in Perl, Java, C and C++ for the past few years and although I prefer using perl and bash I must say that I've learned to think like a programmer having learned C++ first.

    I also eneded up taking a C++ course in High School, and I found that many of my classmates started to think and analyze problems differently. A year later the school changed from C++ to Java ( because the CollegeBoard changed it's CS exams to Java). I also took that class and I noticed that the kids that only took Java, even after completing the course did not learn much - and especially not to think like programmers. I think that this is most likely because Java has so many libraries within that the kids never actually learn what occurs in the "back end." Many fail to understand what a string is, and the majority did not understand algorithms at all, I dont want to mention efficency. Although Java is probablly used more widely, I think that for beginners to learn to think like programmers it would be better to learn a language from which they can learn the basics behind programming, and although I would suggest PASCAL (better for learning algorithms) ,C++ should be taught before Java.

    Learning DSA with Java is a bit funny, how is having a garbage collector efficent and how will that inspire programmers to write more cautius and efficent code?

    Just my opinion, I'd like to learn more.

  20. Closed-mindedness abounds by mattgreen · · Score: 3, Insightful

    C++ takes quite a bit of flak on here, mostly because it doesn't try to be a 'pure' language. It is obvious that people don't understand it by the comments. (Then again, if people only talked about what they understood, the net would be a very quiet place.)

    News flash: most software that I've seen and written benefits from multiple paradigms: procedural for basic algorithm implementation, OOP for the architecture, and generic programming as glue code (generic programming annihilates OOP in terms of code reuse, and you typically don't pay a performance penalty for it.) There are other paradigms, but I don't have enough experience to comment on the efficiency of them. C++ is one of the few languages that gives the aforementioned paradigms a presence and trusts the programmer to choose. You may think this is 'bloated,' but nothing is further from the truth: the overall mantra of C++ is, "you only pay for what you use."

    You can bitch all you want about the importance of language purity and point to languages like Smalltalk or Java as an example of how software should be coded. I'll ask you to point me to popular desktop software that is written in these languages. C++ is the archetype of a hardcore language - a huge learning curve, but insanely powerful in the right hands. It is also really dangerous in the wrong hands.

    Like operating systems, all programming languages suck in some way. Its up to you to choose the least sucky one for the problem at hand. I enjoy writing native, minimal dependency desktop applications in a language that has excellent tool support, can interface directly with OS APIs, and doesn't talk down to me. C++ fits the bill most closely, but I've been told I'd like O'Caml as well.

    C++ isn't going anywhere. The fact that so many people don't understand it or the place that it occupies only strengthens my resume.

  21. Multi-language approaches by Anonymous+Brave+Guy · · Score: 2, Insightful
    The ideal way of doing things is to write as much as you can in the scripting language. This is almost always faster and more efficient in terms of programmer time. Then, you go back and redo the speed critical bits and pieces in C or C++.

    I've heard that a lot, and certainly the argument has merit.

    Where it sometimes breaks down, IMHO, is that learning a new language isn't free. It's a myth that any good programmer can learn a new language in a week. Sure, they can learn the basic syntax, and if they're familiar with the particular paradigms they're using (by which I mean OOP, functional programming, whatever) then they'll be able to apply those principles fairly readily. But there's a world of difference between that and the kind of clean, idiomatic, easily maintainable code than a good programmer with a lot of experience in the specific language(s) he's using would write.

    I predict that this is going to be one of the bigger factors holding back $SCRIPTING_LANGUAGE from wider usage for a long time. There are simply too many almost isomorphic scripting languages with a significant, but still small, user base, and while they offer similar advantages, you can't just switch a whole dev team from one to another for the reason above.

    I think this is also a big reason C++ remains popular, particularly with stronger programmers who make the effort to learn its idioms, who for some probably related reason rarely seem to encounter all these dreadful weaknesses C++ is supposed to have... In a nutshell, C++ is a single language with sufficient tools to work effectively with both low-level details and high-level designs, and perhaps a strong programmer with such a tool will be more effective than a programmer with two more suitable tools, but only moderate skill with either.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  22. zerg by Lord+Omlette · · Score: 2, Informative

    C++ Guru Scott Meyers just asked people, "Why do you program in C++?" If that's not relevant to this discussion, I don't know what is... (via Lambda the Ultimate)

    --
    [o]_O
  23. Re:To those who have not programmed in C++ enough. by Anonymous+Brave+Guy · · Score: 2, Insightful
    I just don't think there are _any_ good solutions for writing large, portable, comprehensible, etc. programs.

    Sad, but almost certainly true.

    As I've said in these parts before, C++ should have been superceded for all areas of programming a very long time ago. The fact that it hasn't is a pretty damning indictment of the software development community as a whole, a reflection of how little "new" languages like Java or C# have really added, and an insight into how productive many theoretically sounder languages beloved of academics are out in the real world.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  24. Re:Sometimes C++ programmers miss the point by ufnoise · · Score: 2, Informative
    When programmers are a major cost (believe me, at Wall St. firms, they are a huge cost compared with the cost of machines), you should optimize the amount of time they spend waiting for compiles. We have a C++ library that is around 250,000 lines of code, that compiles in around 2 hours (and this is after a lot of work to try to make the compilation as fast as possible). We also have a 1,200,000 line java library that compiles in around 3 minutes. Any way you play it, programmers still spend a lot of time in the write code / compile / test cycle. In fact, this is where they spend most of their time.


    Perhaps you need to take a look at your build system.


    If an incremental change to you program is triggering a massive recompilation of everything there may also be a problem in how include's are being handled or your make files. There are several well known techniques to reduce this.

  25. C++ loses its 3rd position after almost 4 years by mAriuZ · · Score: 2, Interesting
    "The TIOBE Programming Community index gives an indication of the popularity of programming languages"

    Here is the link http://www.tiobe.com/tiobe_index/tekst.htm

    --
    developer http://flamerobin.org
  26. (A lot of times) C++ programmers miss the point by Latent+Heat · · Score: 2, Insightful
    You have gotten a lot of responses, some of them diplomatic, others unnecessarily blunt, telling you that you don't know what you are doing if your C++ compile times are that long, and suggesting tweaks -- better make files, pre-compiled headers.

    Well, you and your colleagues could bone up on the skills to compile large C++ programs, but you could also hire some people who are experts at IBM OS/360 JCL while you are at it.

    Anyone here remember JCL? The idea was that you had a "separation of concerns" between abstract operations on files (Open, Read, Write, Seek, Close) and a whole panoply of file-specific parameters (disk, tape, random-access, sequential, block size, buffer sizes), and that you only had the abstract parts in actual compiled code while the connections between the abstract parts and the OS went into a kind of shell script that specified these connections. Then these guys in New Jersey came up with this Unix thingy which didn't have any of this stuff. Unix "solved" the problem JCL was addressing by not having that problem in the first place.

    My point is not that Java is "better" than C++ -- there are many criteria in what language is suitable for what kind of problems -- but that C++ is so ancient history even within its own problem domain. Make files? Pre-compiled headers? The problems those features were meant to solve were obviated by Wirth and his gang back in the Modula 2 days just like Unix made JCL go away.

    The suggestions you have rolling in to speed up your C++ compiles are all well and good, but the fact that people are calling you stupid. How about another analogy. The F-104 has some bad user-interface issues along with slim stall margins on landings. It killed a lot of pilots in its day, and the pilots who survived would all say that the pilots who didn't lacked "the Right Stuff", but I don't think there are any Air Force planes these days that are quite so unforgiving.