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.

241 comments

  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

    1. Re:C++ Should Be The Only Programming Language by Anonymous Coward · · Score: 0

      Since maybe like the Middle Ages, there have been many differing opinions on hustle and bustle. This cannot be denied. It is my intention to sit down and play video games for several hours.

      First, moving around quickly, and with purpose, is a true sign of character. Secondarily, bustle(e.g. hustle) yields more product for the working types. "Hustle and bustle are like my right and left arms," said Li'l Spicy in his famous "Hustle and Bustle Are Like My Right and Left Arms" speech. Webster's defines bustle as "excited and often noisy activity; a stir." A stir, indeed. Finally, sometimes gross stuff can be funny.

      In conclusion, I, "The Yellow Dart," think I have done a great job illustrating the many differing opinions about hustle and bustle, may they both rest in peace. Also, I think Strong Bad should decrease The Cheat's allowance.

    2. Re:C++ Should Be The Only Programming Language by jmccay · · Score: 1
      C++ is still far better than Java. What most people call Java benefits are truly it's drawbacks too. The least you could do is get the dates right. Here is a history of C++. From the article:
      C++ was written by Bjarne Stroustrup at Bell Labs during 1983-1985. C++ is an extension of C. Prior to 1983, Bjarne Stroustrup added features to C and formed what he called "C with Classes". He had combined the Simula's use of classes and object-oriented features with the power and efficiency of C. The term C++ was first used in 1983.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
  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 javax · · Score: 1

      well yes, author would have been a better choice imho.

    2. 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)

    3. 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.

    4. Re: creator of the C++ programming language by FidelCatsro · · Score: 1

      He created an object oriented extension to C called C++(we call sun the creator of java and java is basicaly an extension to C also) , so he is the creator of C++.
      Creator is the correct word or designer , architect take your pick its all fine.

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    5. Re: creator of the C++ programming language by black+mariah · · Score: 1

      The differences in C and C++ are extensive. About the only thing they truly share are braces and semicolons to end lines. Calling C++ and extension of C is like calling a battleship and extension of a yacht. Sure, they're both boatlike but that's about where the similarities end.

      --
      'Standards' in computing only impress those who are impressed by things like 'standards'.
    6. 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.

    7. Re: creator of the C++ programming language by nacturation · · Score: 1

      Using OO sucks in C++

      At least in C your bugs are all yours.


      So when using libraries in C++, all your bugs are belong to us?

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
    8. Re: creator of the C++ programming language by Anonymous Coward · · Score: 0

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

      In the same way that C is an 'extension' of BCPL, which is an 'extension' of the Latin alphabet. So all the credit for creating C++ should really go to the guy who thought of poking sticks into clay tablets back in Babylon a few thousand years ago, right?

  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 Anonymous Coward · · Score: 0
      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.

      So provide some facts please, rather than your bullshit opinion.

    2. 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
    3. 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
    4. Re:While it would be nice... by BigZaphod · · Score: 1

      "But this nannying produces only poorer developers who rely on the language rather than their own abilities to code effectively."

      I know this is shockingly off-topic, but it is interesting how stating something like that seems pretty obvious and logical when talking about computer programs. The reason I mention this is that your comment could very easily be applied to western (or at least American) culture in general. We have become a culture of safety where anything even remotely dangerous is banned or sectioned off. Everything has guardrails now.

      After spending some time in middle-to-eastern Europe, the differences in thinking in that regard are quire amazing. Everything is so "safe" in America for fear that people will hurt themselves and go on a suing rampage. I think it is creating some pretty pathetic and petty people which isn't going to bode well in the future.

    5. 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.

    6. 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!
    7. Re:While it would be nice... by 0x461FAB0BD7D2 · · Score: 1

      Personally, I believe it survives because it mixes the robustness of object-oriented languages with the minimalistic procedural approach. It survives because its design is adept at conforming to anything thrown at it.

      Java, for one, doesn't allow for RAD. It requires a structured design and systematic coding. People have invented scripting languages based on Java, and this highlights Java's serious lack of flexibility. The problems with .NET are obvious - it's tied to one platform and the framework required is quite substantial.

      While C++ may be an abomination in terms of language theory, it serves the purpose it was intended for - to meld the C programming language with the OOP paradigm.

    8. Re:While it would be nice... by 0x461FAB0BD7D2 · · Score: 1

      Actually, you are right. There isn't anything wrong with std::string. However, a regexp feature, a la Perl, would be nice.

    9. Re:While it would be nice... by MrDomino · · Score: 1

      It's clunky, and something of a workaround; strings are still treated as char * types internally unless stated otherwise, so you have to jump through some hoops to get proper string manipulation. You can't, for instance, do this:

      std::string s = "Hello, " + "World";

      C++ interprets that as adding two pointers to type char together, which does nothing useful whatsoever. Instead, you have to do this:

      std::string s = (std::string)"Hello, " + (std::string)"World";

      Further, string manipulation is inconsistent; many of even the C++ standard library functions don't handle strings themselves. Ever tried initializing an fstream to a string? You can't do it; you have to use the string's c_str() method.

      I program in C++ a lot and do appreciate a lot of the language's strengths (templates are brilliant for implementing data structures), but there are definitely some things that it is not good at, and string handling is one of them.

    10. Re:While it would be nice... by Anonymous Coward · · Score: 0

      Regex classes have been added to C++ in TR1, which will eventually become the next C++ standard in 2005 or 2006.

      GCC 4 even has working implementations of all the TR1 stuff already (mostly based on code in boost).

      See the docs about what other goodies are in the std::tr1 namespace. New smart pointers, regexes, better I/O, and so on. The stuff many people have been wishing for :)

    11. Re:While it would be nice... by Anonymous Coward · · Score: 0
      using std::string;
      string s = string("Hello, ") + "World";

      Works just fine.
    12. Re:While it would be nice... by 0x461FAB0BD7D2 · · Score: 1

      I haven't been keeping up with C++ in a while because of school, which is fixated on Java. I'm still a C/C++ fan at heart.

      Thx for the heads up. I can't wait for GCC 4 (Cygwin) with tr1.

    13. Re:While it would be nice... by MrDomino · · Score: 0

      The point is that you have to cast to a string in order to get string functionality. That only one cast is needed instead of two is beside the point; it's still clunky, and languages with built-in string support are much better about string manipulation than C++.

    14. 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."
    15. Re:While it would be nice... by 0x461FAB0BD7D2 · · Score: 1

      I actually like Boost, but it would be nice to have it as part of the standard itself. C++ is woefully lacking in features that newer languages likes Java and C# have by default.

      I haven't fiddled around with Boost threads though. How would you rate them against protothreads?

    16. Re:While it would be nice... by Anonymous Coward · · Score: 0

      Please re-read the post. That is not a cast but creation of an anonymous object and then concating a const char* array.

    17. 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++.

    18. Re:While it would be nice... by FidelCatsro · · Score: 1

      That comment had nothing really to do with C++ other than it being another language ,it was related to the hamering a nail with a screwdriver simile.

      I probably should have said
      You dont hammer a nail witha screwdriver , and you dont program a modern "First person shoot'em'up" in java.
      But the point remains the same

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    19. Re:While it would be nice... by mobydobius · · Score: 1

      never used protothreads. im not an expert thread programmer, and i like boost::thread because i find the interface and usage pattern recommendations simple enough to follow, but not dumb enough not to do useful things with it. it doesn't aim to be a cutting edge thread library, but a library that encapsulates stable thread notions, and can be used to build higher level ideas.

      iso c++ standard moves slow to be sure. since much of boost is a proving ground for the standard, and since it has its own review process that seems stringent enough, i find it can be used along with std as a "better" standard library.

      --

      "I like to wear big boy pants."
    20. Re:While it would be nice... by slamb · · Score: 1
      out of interest, what's wrong with std::string?

      It doesn't support Unicode well. Specifically,

      • It doesn't support variable-length character encodings like UTF-8 or UTF-16.
      • wchar_t is not a standard size. (It may be two or four bytes, depending on your platform.) So you need to define your own ucs4_t specialization to portably hold wide characters.
      • There's no decent transcoder in the standard. boost has utf8_codecvt_facet, but currently it's for internal use only. (With a class like this, you could use std::string with above ucs4_t and still do UTF-8 I/O.)

      The best workaround I've found is to require Glibmm. It's a huge dependency, but it has a UTF-8 string class and appropriate conversion functions.

      But fuck workarounds. I'd rather just code in a language with a standardized string class that doesn't suck. This sort of thing is why my largest C++ project is stagnating while I write code in other languages.

    21. Re:While it would be nice... by aCapitalist · · Score: 1

      I agree with your point that C++ fills a void. And no matter how many times I've cursed the language (I've written more lines of C++ in my professional career than any other language), I still think it was stupid that de Icaza chose C over C++.

    22. Re:While it would be nice... by FidelCatsro · · Score: 1

      C and C++ each fill a void but those two voids all too often cross over .
      Also I guess its which of the two your more comfertable with , perhaps c++ would be a better all purpose choise , but if he has more experiance with C, it can more than make up for any short-commings.

      --
      The only things certain in war are Propaganda and Death. You can never be sure which is which though
    23. Re:While it would be nice... by Anonymous Coward · · Score: 1, Interesting

      BeOS was written in C++

    24. 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.

    25. Re:While it would be nice... by Unordained · · Score: 1

      I've never understood this. What's with people's fascination with the libraries provided with a language? On the one hand, we have people complaining about how awful C++ is in terms of "language design" (by which they're referring to the actual grammar of the language, what you can/can't do with it) and on the other, people complaining about what libraries come with it. I always thought that, given that most languages are capable of importing any new libraries you give them, the vocabulary wasn't an issue: if they don't provide you with function XYZ that you can imagine and want, then you just write it yourself, or find someone else who did. That's all we're doing anyway: every program we write is just an addition to the namespace. I always thought the strength of a language was at least in part determined by how easy it was to extend: did it give you everything you needed to build new functions, classes, etc.?

      People pick their development platforms no longer (did they ever?) so much on the language itself but what functions are "easily accessible" (the fewest lines of #include-like code) to them. Yes, there's a productivity issue, but ... dang. That's just harsh. You could have the best "language" in the world, and yet nobody would notice it until it came "standard" with a library the size of java's. (Which, by the way, is enormous, and I doubt I'd ever find what I was looking for in such quantities of code anyway.) You could have the worst language in the world, or at least a terribly half-assed one, and it'd still be used if it came with all the functions people happen to want at the moment (which is distressingly related to what technologies are "hot" at any particular point in time.) We talk about how great Java and PHP and Perl's basic libraries are, yet we have sites dedicated to sharing code that isn't included by default (CPAN, that new O'Reilly equivalent for Java, PEAR, etc.) ... so obviously, despite their size, they're still not "quite enough" ...

      Are we ever going to go ahead and figure a way to make sure libraries we write in one language are available (easily) in others, so we can get down to the business of picking languages based on language features? C provided us with a basic interoperability which I don't think we have for object-oriented languages (OO is a vague concept anyhow) ... but it's hurting us to be rewriting the -same- algorithms, for the -same- purposes, for each different language.

      Note that parts of the Boost library may be included in future C++ standards, according to their website. Not like that addresses my issues, but for those who like Boost, it's something. Now if, Boost were available to all languages ...

    26. Re:While it would be nice... by 0x461FAB0BD7D2 · · Score: 1

      Entirely true. However, there is a difference between languages like PHP, Java and C++: for the former two, the modules or libraries are largely centralized, while for C++, there are so many ways to do the same thing. This means that shared libraries would have to be deployed together with the application itself.

      While not everything can be included in any language, for it would truly be a behemoth to program and deploy, there are some things which all languages should have. The problem is where do you draw the line? Is CGI something all languages should support by default? Should languages have built-in support for Regular Expressions?

      The line is usually drawn by the company/individual(s)/organization(s) that created and oversee the language. And sometimes, as in the case of C++, it was drawn too early. Fortunately, they will change that with further reviews of the language.

      As for writing libraries that could work with any language, Microsoft has tried that, and quite honestly failed. However, it's an unenviable task, especially with the variety of deployments, platforms and features that need to be supported. If anyone does suceed in doing so, they would be the 21st century equivalent of Kernighan.

    27. Re:While it would be nice... by Cocteaustin · · Score: 1
      The problems with .NET are obvious - it's tied to one platform and the framework required is quite substantial.
      Not true.
    28. Re:While it would be nice... by Ninja+Programmer · · Score: 1
      out of interest, what's wrong with std::string?
      See http://bstring.sf.net/features.html for my own take on std::string and other string libraries.

      In short, its slow, it doesn't have bounds protection, has slow interopability with char * strings, has mediocre functionality (no insert, no overwrite, no find-replace, no split/join, no useful line-input). Various implementations have thread safety problems, and I don't know if it is aliasing safe.

      Of course it is possible to implement safe and powerful string handling in C++ (http://bstring.sf.net/) but std::string is not a solution that is comparable to the abilities other languages.
    29. Re:While it would be nice... by Anonymous Coward · · Score: 0
      You have a choice between two syntaxes:
      std::string s = "Hello, " "World";
      or:
      using std;
      string s = string("Hello, ") + "World";
    30. Re:While it would be nice... by Lars+-1 · · Score: 1

      While it is true that in C++ OO is bolted on a procedural language, I see no problem here. Any compiler construction book shows that this the normal way of implementing OO to run on todays processors.

      What I don't like in Java is that they seem to take away features of OO which may be used wrongly, namely multiple inheritance. The idea is probably to take away the gun to shoot yourself into the foot, but I actually find the gun useful. What C++ gives you is full power and flexibility. Using that power wisely is left to the programmer. I use C++ and Java on a daily basis. Features I have come to miss in Java are multiple inheritance, friends and protected and private inheritance, and of course templates.

      I think those are the main reasons C++ is still here. You can do things with it which are simply not easily possible with other languages.

      Lars

    31. Re:While it would be nice... by slamb · · Score: 1
      What's with people's fascination with the libraries provided with a language? [...] I always thought that, given that most languages are capable of importing any new libraries you give them, the vocabulary wasn't an issue: if they don't provide you with function XYZ that you can imagine and want, then you just write it yourself, or find someone else who did

      Because when you're an open source programmer working on small projects, you want to pull in several different libraries and use them together. If they all have their own string classes, it's all but impossible to use them together. That's unacceptable.

      The language design is only have of the picture. As you say, the API is the language's vocabulary. You need a standardized vocabulary to communicate.

    32. Re:While it would be nice... by Anonymous+Brave+Guy · · Score: 1
      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++.

      OK, I'll play. Let's stick to current, reasonably popular operating systems to make things easier. Which do you think are written in C?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    33. Re:While it would be nice... by MrDomino · · Score: 0

      I wasn't aware of that first syntax; that's actually pretty nice. Thanks!

      Regardless, though, there are some things with strings that C++ just isn't good at, as I mentioned.

    34. Re:While it would be nice... by aCapitalist · · Score: 1

      the BSDs, including OSX, linux, probably all commercial Unixes, Linux, probably most of Windows (from the actual source of 2000 I've seen), with some parts C++ (the original NT programmers lamented Cutler's decision to force C++ on them for the GDI)...what else..probably QNX and most other realtime operating systems. Even BeOS used C for its kernel.

      I woud say that most userspace operating system code is stil written in C over C++...even on windows.

    35. Re:While it would be nice... by Fat+Cow · · Score: 1

      I find C++ very good for machine vision software, and only OK for GUI programming.

      It's fast and has many features that give you flexibility in design (templates, multiple inheritance, operator overloads etc).

      For GUI I prefer C# or Visual Basic.

      --
      stay frosty and alert
    36. Re:While it would be nice... by MastaShredda · · Score: 1

      Boost has become something of a godsend recently. I was introduced to the Boost libraries this past semester by my DirectX/C++ profs, and it has helped greatly in more than one occasion. Shared-ptrs/scoped_ptrs have helped a ton (especially with delegate usage in DirectX). I've also heard the rumours that a good portion of Boost is going to be included with the standard C++ library. /crosses fingers.

    37. Re:While it would be nice... by bluGill · · Score: 1

      Several of the people behind boost also sit on the C++ stand committie. They have suggested that boost is a proving grounds for things that will be in the next standard.

    38. Re:While it would be nice... by eraserewind · · Score: 1

      Symbian OS (for mobile phones) is coded in C++.

    39. Re:While it would be nice... by the+eric+conspiracy · · Score: 1

      Java, for one, doesn't allow for RAD. It requires a structured design and systematic coding.

      Not true at all. Agile programming has addressed that concern by advocating frequent refactoring rather than top down design.

    40. Re:While it would be nice... by Anonymous Coward · · Score: 0
      Please re-read the post. That is not a cast but creation of an anonymous object and then concating a const char* array.

      Shit, you're right! That's so intuitive! Way better than Java!

    41. Re:While it would be nice... by anomalous+cohort · · Score: 1
      what's wrong with std::string?

      What's wrong with the Standard Template Library's string class is that it came too late to the party. For years, C++ was missing an object oriented way to handle character data. C++ software library builders had to roll their own. MFC has CComBstr and CString. Qt has QString. Xerces has XMLString. Try writing an application that combines different libraries and you quickly end up in string conversion hell.

    42. Re:While it would be nice... by srid · · Score: 1

      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.

      Actually the reverse is true

      --
      - srid
    43. Re:While it would be nice... by jisatsusha · · Score: 1

      You could at least check the url before you post.

      <br>
      <a href="http://www.mono-project.com/">http://www.mon o-project.com/</a>

    44. Re:While it would be nice... by jisatsusha · · Score: 1

      ok, I've made myself feel a bit silly now. anyway, try number 2:

      http://www.mono-project.com/

    45. Re:While it would be nice... by vanourek · · Score: 0

      You've seen some of the Windows source? Wow, can I touch you?

      Seriously though, what language is a C interpreter written in?

    46. Re:While it would be nice... by vanourek · · Score: 0

      What machine vision library do you use, OpenCV?

    47. Re:While it would be nice... by menace3society · · Score: 1

      PHP? Whose crack are you smoking? PHP is like somebody's bastard stepchild, only with a lot more buffer overflow vulernabilities. Someday, people will realize how useless (and not to mention dangerous) it is, and throw the whole thing away. If PHP is the language for the future then the future is quite fucked.

    48. Re:While it would be nice... by menace3society · · Score: 1

      There are no C interpreters. There are C compilers, but those are more often than not simply bootstrapped from a previous C compiler. In the beginnging, though, they were all assembler. As was everything else

  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.

    2. Re:C++: too complex by Anonymous Coward · · Score: 0

      Who moded the parent up ? its a classical troll , look it up .

    3. Re:C++: too complex by Bloater · · Score: 1

      > I remember seeing those "What's wrong with this program?" ads with C++ examples and being utterly confused.

      Q: "What's wrong with this program?"

      A: "It's written in C++."

    4. Re:C++: too complex by aCapitalist · · Score: 1

      Listen, C++ is complicated because it's a 3 paradigm language. In the hands of someone that knows what they're doing it can produce nice code.

      If you want to talk about half-baked, let's compare Gnome/Gtk+ to Qt/KDE. You have performance issues that would only be solved with something like C or C++, and when it comes to technical superiority there is no doubt that Qt and KDE are better.

      Frankly, many unix heads and others are just afraid to learn something more complicated, but much more powerful. You can do many neat and useful things with templates. Just look at Boost.

    5. Re:C++: too complex by anthony_dipierro · · Score: 1

      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.

      Is that supposed to be a joke? Because, if anything, it's the opposite that is true.

      True, there may be complex parts hidden away in libraries to handle some things like memory allocation, but once those are written the features of the program itself are no more complex.

    6. Re:C++: too complex by Dixie_Flatline · · Score: 1

      C is a perfectly fine language to program even large scale projects in. I know for a fact that both MDK II (BioWare) and Halo (Bungie) were written entirely in C. (In fact, everything in Halo was statically allocated! No mallocs!)

      This quote is 15 years old, but I still think it gets to the heart of the matter:

      "If you think C++ is not overly complicated, just what is a protected abstract virtual base pure virtual private destructor and when was the last time you needed one?" --Tom Cargin (C++ Journal, Fall 1990)

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

      OCaml ( http://www.ocaml.org ) performs almost as well as C++ and still is a much higher level programing language with more powerful constructs and very low memory footprint.

    8. Re:C++: too complex by Leimy · · Score: 1

      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.

      That explains your preference of Objective C. It's a lot more like Smalltalk.


      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.

      So you like Objective C because it's easier to compile everywhere than a C++ program?. That's complete crap and I'm sure you know it. C++ doesn't require anywhere near the amount of runtime support that Objective C does. Most of the new Objective C code written today is confined to a single platform, Mac OS X. How is that code portable?

      There was once a time when OpenStep was more evenly distributed and portable but now all we have is Cocoa and GNUStep.

      I find this particular line of argument to be invalid.


      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. :-)


      No doubt, the language is complicated and requires more attention to details than C or your favorite scripting language of the day.


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


      I use Java almost every day now. I have to code back in the features I liked that came with C++'s STL in Java generics because C++ was just better targetted at generic programming it seems. The STL is a very powerful mechanism. Templates, not generics, are also very powerful and a surprising number of compilers are getting it done correctly these days with little to no code bloat.

      Of course the way I use templates [metaprogramming] is probably more advanced than someone who claims to not see the point of C++ could easily understand.


      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.


      C++ is very agile. You're not even making a real argument. I've seen C++ used in embedded systems, microkernel implementations, web servers, High Performance Computing projects. In fact it's a simple fact that even with the added language complexity some C++ code can end up ALWAYS being faster than the equivalent C code. [due to judicious use of things like templates, objects, and functors].


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


      <*Shrug*>

  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. Stroustrup disconnected from reality. by Anonymous Coward · · Score: 1, Interesting
    From TFA:

    Data from analyst firm Evans Data, which carries out regular developer surveys, appears to contradict Stroustrup's claim that C++ is growing. Evans Data has found that the percentage of developers using C++ has steadily declined over the last six years--from 76 percent in the spring 1998 to 46 percent in fall 2004. But it expects the rate of decline in C++ developers to be "considerably slower" in the next few years.

  8. 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.
  9. 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.

  10. 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.
    2. Re:The reason I don't use it by neonstz · · Score: 1

      A week ago, Bjarne Stroustrup was giving a talk about the work on the next C++ standard.

      One interesting thing that he mentioned, was that C++ was quite popular for embedded programming. Templates is a very nice way to make the compiled code small and run fast (if you got a good C++ compiler of course).

    3. Re:The reason I don't use it by melatonin · · Score: 1

      C++ has a very simple philosophy, you don't pay for what you don't use.

      My ass. The whole point of object oriented programming is abstraction and encapsulation. Try working with two different C++ systems at once. Say, anything and OmniORB. One library might use RTTI, while another might be working on a KISS base class. Another library may be throwing all kind of exception shit. One library may be using std::except, the other might be throwing ints. Or worse, the library implementor may have not read the 3 lb. "The C++ Programming Language" (try fitting that in a PDF), and is using catch (...) {throw runtime_except()} instead of just 'throw', obliterating any exceptions that you're trying to throw through it.

      Hm. I've just gone off an a exception rant there. Let's get back to OmniORB. What if you need to inherit from two classes to get some functionality of both? What if they didn't inherit 'public virtual' from their super class? What if the people writing those classes doesn't know shit about virtual inheritance? What are the odds that someone does?

      What if someone's code uses 'new' to allocate everything, and other code uses STL and puts everything on the stack, using copy constructors for everything, and enjoys using exceptions and the fact that stack-based objects get deallocated for free? How are you going to handle memory management? I'd love to take a quote from "The C++ Programming Language," but it's 1000 pages long and I don't think I can find it. Basically, they punt on memory management, saying "It's a complex job and there are many ways to do it, so the problem is left as an exercise to the reader. Overload new."

      With C++, eventually you're going to pay for everything.

      --
      Moderators should have to take a reading comprehension test.
    4. Re:The reason I don't use it by Anonymous Coward · · Score: 0

      Templates is a very nice way to make the compiled code small and run fast.

      Er... what? Templates can do many remarkable things, but "making compiled code small" is not often mentioned among their virtues. A template is compiled separately for every single type it's instantiated with, right?

      Sounds to me like this "good C++ compiler" you mention is one of those "sufficiently smart compilers" - you know, the ones that can compile vague English descriptions to be faster than C while eliminating all errors at compile-time and proving that arbitrary programs terminate.

    5. Re:The reason I don't use it by Anonymous+Brave+Guy · · Score: 1
      A template is compiled separately for every single type it's instantiated with, right?

      Simplistically, yes. But, for example, it's common to implement specialisations such that all pointer types use the same code (based around a void* and casting internally), thus gaining all the advantages of type safety and code reuse, but without the bloat. The same concept could be applied in other contexts as well, though I'm not aware of any mainstream development that uses it so at present.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    6. Re:The reason I don't use it by Anonymous+Brave+Guy · · Score: 1
      One library might use RTTI, while another might be working on a KISS base class. Another library may be throwing all kind of exception shit. One library may be using std::except, the other might be throwing ints. Or worse, the library implementor may have not read the 3 lb. "The C++ Programming Language" (try fitting that in a PDF), and is using catch (...) {throw runtime_except()} instead of just 'throw', obliterating any exceptions that you're trying to throw through it.

      So in other words, if you don't RTFM so you know what exceptions the libraries you use might throw and/or you make kindergarten errors in your fundamental design, things break. No kidding.

      In any case, you're completely misunderstanding the point of the zero-overhead principle, and your arguments are therefore pretty much irrelevant to what the grandparent post said.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    7. Re:The reason I don't use it by prash_n_rao · · Score: 1

      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 did not say C++ does not have a good set of libraries. I said "...lack of sensible libraries as part of the standard." :-) I know there are a ton of libraries for lots of things in C++, so, generally, it is not necessary to revert to C libraries.

      When you are working with MFC, QT or Motif (C libraries) you can't get away with using std::string for all your strings. Each set of libraries come with its own implementation of string classes.

      The cribs I had about C++ not having enough in the standard apply just as well to C too.

      Of course, to prevent the standard from getting bloated, they could have different libraries included in the standard for different application/OS profile, somewhat like what POSIX has done for C.

      --
      This is not my sig.
  11. 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.
    1. Re:Ousterhout's Dichotomy by Anonymous Coward · · Score: 0


      How do you debug Tcl? IIRC, you have to *ask* it for error information.

  12. Re:To those who have not programmed in C++ enough. by Anonymous Coward · · Score: 0

    Java Generics is not even an attempt to come close to template programming. BTW, this book is quite neat but misses more advanced topics about templates. Take a look at the boost libs.

    Ah, and, I heard you can shoot your leg off with C++. Blowing my mind? Maybe worth a try.

  13. 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.
    1. Re:I've always liked C++ by Anonymous Coward · · Score: 0

      There have been languages designed to not allow for such easy self destructions as they are usual in C/C++, *without* compromising expressive power. You may not have guessed it but I think of Ada 95 here. Even better some language constructs such as the type system or the threading primitives are even *more* expressive than in C++.

    2. Re:I've always liked C++ by coaxial · · Score: 1

      Have you considered Lisp? Seriously. Lisp is pretty much just lambda calculus. Generic functions, run time evaluation. Object orientation if you want. It's incredibly free form, and provides garbage collection, before and after methods, and other advanced structures.

      I know it's become a joke to suggest Lisp, but those that laugh have never used Lisp.

    3. Re:I've always liked C++ by renehollan · · Score: 1
      Yeah, I've considered Lisp, usually whenever I wonder at the plethora of different grouping constructs in C/C++/C#/Java: (), {}, [], and <> (templates), and question their usefulness.

      They do add syntactic and semantic sugar, of course, but really, I'd like to be the one to define the kind of syntactic sugar they add. It's also the one thing that Lisp lacks: any kind of syntactic or semantic sugar. Forth might have an edge here, but it is less formal a language.

      --
      You could've hired me.
    4. Re:I've always liked C++ by renehollan · · Score: 1

      C# allows for "unsafe" code as well, but it's an all or nothing proposition. For example, I can't declare a section of code as not being permitted to call code with certain attributes, like effecting memory allocation and/or deallocation.

      --
      You could've hired me.
    5. Re:I've always liked C++ by Anonymous+Brave+Guy · · Score: 1
      I know it's become a joke to suggest Lisp, but those that laugh have never used Lisp.

      (oh (yes (we (have))))

      LISP has a lot going for it, but it also has a lot against it. The most popular programming languages in general use today have a lot of things in common with each other and not with LISP, starting with providing syntactic sugar for various common control structures and vast libraries. Sure, you *could* define your own control structures in LISP and write your own libraries, but why bother when you can just use a tool that saves you the trouble? Flexible-but-underpowered is why almost no-one writes new applications in C any more.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    6. Re:I've always liked C++ by coaxial · · Score: 1

      The most popular programming languages in general use today have a lot of things in common with each other and not with LISP, starting with providing syntactic sugar for various common control structures

      If you mean they all have an algol-like syntax, then you're correct. However I don't know what you mean by "sugar for common control structures".

      and vast libraries.

      Apparently, you haven't really used Lisp, or you'd know that most things that are in standard libraries are handled internally by the language. Also you'd know that you'd know that lisp provides hooks to use foriegn language libraries just like pretty much every other language.

      Sure, you *could* define your own control structures in LISP and write your own libraries, but why bother when you can just use a tool that saves you the trouble?

      See above about libraries.

      Name control structure that doesn't exist in Lisp.

      I've never come across a concept that couldn't be easily and directly expressed in Lisp. Conversely, I've found things many things that are easily to do in Lisp, yet incredibly difficult to do in other languages. Generic functions, before and after methods, function redefinition (including locally redefining a function) (This IS NOT to be confused with polymorphism.), and injecting code changes into a running system to name a few.

      Flexible-but-underpowered is why almost no-one writes new applications in C any more.

      And with that statement, you lost all credibility.

    7. Re:I've always liked C++ by Manuel+Lafond · · Score: 1

      you say that languages like C# or Java do the tough work for you or just refrain you from doing 'dangerous' things (like Java cutting off multiple inheritance), thus reducing your flexibility
      of course I can't argue with that - it's so true
      and believe me I love C++ and often use it for personal project

      however I think the problem is that nowadays the complexity of software is always increasing - along with the number of poor developers that manage to get a job (yes it does happen a lot)
      these contribute to the fact that something like 80 % of software projects end up in failure (or more depending on your definition of failure)

      a lot of programmers are needed out there - and we have to consider the fact that some of them are actually dumb because in 2005 everyone's a programmer - and if we begin to let them handle things such as pointers and multiple inheritance, someone in the company's gonna do things the wrong way
      I've seen too many bad programmers to assert that we should choose the complex-but-flexible over the simple-but-limited

      --
      you slashdot geeks only criticize people...finally a community where I'm not different
    8. Re:I've always liked C++ by coaxial · · Score: 1

      They do add syntactic and semantic sugar, of course, but really, I'd like to be the one to define the kind of syntactic sugar they add.

      You may be able to do something kind of like this with Lisp reader macros, but frankly I think it's impossible, or at least near impossible.

      It's also the one thing that Lisp lacks: any kind of syntactic or semantic sugar. Forth might have an edge here, but it is less formal a language.

      I'll grant you Lisp has little syntatic sugar, but it's simplicity yet openness is a sight to behold. It has a purity that other languages lack.

    9. Re:I've always liked C++ by jhoger · · Score: 1

      You're looking for a Lisp or Forth variant, I think...

      -- John.

    10. Re:I've always liked C++ by Anonymous+Brave+Guy · · Score: 1
      If you mean they all have an algol-like syntax, then you're correct. However I don't know what you mean by "sugar for common control structures".

      I mean something that highlights the logical structure of what's going on. The most trivial example is probably picking out sequential vs. iterative vs. conditional logic in algorithms. Of course you can do these things in LISP, via cond and such, but there's no particular emphasis on them; they just look like any other bit of LISP. I realise that this is necessary in a language that prides itself on simple-but-flexible syntax, and indeed that a lot of LISPers would argue that it's an advantage, but experience suggests that most programmers prefer something a bit more explicit.

      Consider, for example, the loop example shown here (scroll down a page or so). While the Scheme code shown has power and a certain elegance, the same algorithm could have been written significantly more clearly and concisely in a language that provides syntactic sugar for list manipulation and pattern matching.

      Apparently, you haven't really used Lisp, or you'd know that most things that are in standard libraries are handled internally by the language.

      I don't know what you think counts as "most things that are in standard libraries", so I'm going to guess that you're talking about the minimalist approach taken by, say, C. I'm talking about the behemoth that is Java's standard library, or a rather more powerful approach like Perl's CPAN. Certainly something like Java's standard library is no demonstration of exemplary design, but the point is that for real tasks, it's often Good Enough(TM).

      Also you'd know that you'd know that lisp provides hooks to use foriegn language libraries just like pretty much every other language.

      Sure. And I also know that in the real world, you usually want imported libraries from other languages to be the fall-back if you really need it and not the primary means of increasing functionality. It's almost invariably a hassle to set it up compared to using something that fits in with your native language.

      Name control structure that doesn't exist in Lisp.

      It's hard not to give a loaded answer to that involving loops and side-effects. My point wasn't that you can't do it, my point was that doing it is "nothing special". You might argue that this is an advantage, and for skilled LISPers you may well be right; I'm talking about average programmers working on typical projects.

      Flexible-but-underpowered is why almost no-one writes new applications in C any more.
      And with that statement, you lost all credibility.

      I take it you disagree, then? Obviously I'm only one data point, but I live and work in a very high-tech area, and both I and quite a few of my friends are professional software developers. Lots of us use C++, quite a few use Java, many of us using $SCRIPTING_LANGUAGE_OF_CHOICE either for utiliities or for web work, but I don't know anyone who's working in C any more, aside from a couple of specialist embedded projects.

      Can you name a few major development projects that have been started in, say, the last five years, that use C for reasons other than being tied to it by compiler availability on the target platforms? Do you think there are anything like as many as there are in, say, Java, C++, or Visual Basic?

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    11. Re:I've always liked C++ by Anonymous Coward · · Score: 0

      that use C for reasons other than being tied to it by compiler availability on the target platforms?

      I've seen new generic libraries written in C for easy multi-language bindings. If you write C you can easily wrap it in C++ and Ada but if you write C++ you've a minor headache wrapping it for Ada.

    12. Re:I've always liked C++ by coaxial · · Score: 1

      I mean something that highlights the logical structure of what's going on. The most trivial example is probably picking out sequential vs. iterative vs. conditional logic in algorithms. Of course you can do these things in LISP, via cond and such, but there's no particular emphasis on them; they just look like any other bit of LISP.

      That's true for most languages. Many languages, like C, Perl, and Java, don't diffferntiate between how a condition is used. It's simply a condition. Others, like COBOL and even Common Lisp, take a more natural language approach to loops (i.e (loop for i from 1 to 10 do ...)). Python also has a natural language like loop syntax, but its loops are primarily of the "for each element in" type, which makes them only marginally more clear than C's (i = 0; i < 10; i++).

      Actually, let me backtrack on that statement. Yes. Lisp's use of parens in atypical, especially when parens are typically only used in arithmetic and logical expressions in Algol like languages. That said, syntax is a pretty trivial thing especially when there's much bigger things like expressability to be concerned with.

      I realise that this is necessary in a language that prides itself on simple-but-flexible syntax, and indeed that a lot of LISPers would argue that it's an advantage, but experience suggests that most programmers prefer something a bit more explicit.

      Maybe you thought that, but I don't think you've had much experience using Lisp.

      Consider, for example, the loop example shown here (scroll down a page or so). While the Scheme code shown has power and a certain elegance, the same algorithm could have been written significantly more clearly and concisely in a language that provides syntactic sugar for list manipulation and pattern matching.

      First off, that's Scheme not Common Lisp. Scheme has some interesting and unique features that differ it from Common Lisp and pretty much other every other language out there. For instance Scheme is has first-order proceedures, where Common Lisp does not. (Symbols have both function-value and a seperate symbol-value in CLISP.) Scheme also has continuations, which I believe is a unique feature among all languages.

      That said, the example shows an ass syntax, but that's not the way loops are typically done in CLISP. Instead there's widespread use of the loop macro, which has gobs and gobs of syntatic sugar. So much so, a loop statement resembles an English language sentence. The loop macro also has a handy collect mode that makes the loop return a list containing the value of the last expression on each iteration through the loop. For instance (loop for i from 1 to 5 collect i) would return the list (1 2 3 4 5). It's quite useful.

      I don't know what you think counts as "most things that are in standard libraries", so I'm going to guess that you're talking about the minimalist approach taken by, say, C.

      And C++.

      I'm talking about the behemoth that is Java's standard library, or a rather more powerful approach like Perl's CPAN.

      It's hardly fair to compare CPAN to anything. CPAN pretty much let's anyone who has thrown some code and perldoc together to submit. It's more like freshmeat than any sort of standardization group. This isn't a knock against CPAN. CPAN is great. I use it all the time. I wish more langugages had a clearinghouse like Perl. But CPAN is by no means "a standard library", since there's no standardization going on what so ever. Yes, certain CPAN packages are included with each Perl release, but not all 15 slightly incompatable MIME modules make the cut.
      In fact, I don't believe any MIME module is included in the standard distribution. If you want to talk about Perl's standard library,

    13. Re:I've always liked C++ by renehollan · · Score: 1
      a lot of programmers are needed out there - and we have to consider the fact that some of them are actually dumb because in 2005 everyone's a programmer - and if we begin to let them handle things such as pointers and multiple inheritance, someone in the company's gonna do things the wrong way

      True, but that is not a good reason to restrict what the skilled, battle-hardened, programmer can do: you're reducing every one's tools to what is "safe" to use by the lowest common denominator. That really wastes good talent, and discourages mediocre programmers from becoming better ones, and, eventually, experts. Yes, Virginia, you need to fail sometimes to learn. The trick is to let yourself (and your subordinates) fail on the things that don't matter so much.

      A parallel involves programmable user functionallity: we'll let users call libraries, but only to one level deep. We'll support automatic configuration to meet constraints, but with severe restrictions. This often happens to simplify implementation but is passed off as "restricting the user to protect them from themselves".

      What happens?

      Skilled, and clever users, and those mediocre ones that eventually have an "a ha!" moment, find they can't do what is logical and rational because of built-in limitations. The very people most qualified to evangelize your good work abandon using it out of sheer frustration. A side effect is that your documentation because a bunch of "exceptions" and "special cases".

      Note that I said it should be possible to declare "safe code only here", for various definitions of "safe" (unlike .NET's and C#'s binary safe/unsafe code dichotomy). The good designer targetting a C++ implementation language will try to eliminate the need for bald pointers in as many places as possible. S/he can't eliminate them, however, in the "smart pointer" implementation, shouldn't be expected to resort to a "lower level" language to provide that implementation, and should be able to tell, at a glance, if a "junior" programmer has used dangerous features (like a bald pointer).

      --
      You could've hired me.
  14. Re:Ruby, etc.... by Ulrich+Hobelmann · · Score: 1
    Dead right.
    All those C dialects just add features that you mostly don't need. Ok, the C++ object syntax (
    foo = 5;
    instead of
    obj->foo = 5;
    in C) is nice.

    Still, the real shortcomings of C aren't fixed, such as braindead syntax, only a single return value for functions (but a function can have 5 parameters; why?), lack of tailcall optimization, braindead calling conventions...

    You might even say that
    public static final synchronized Bla
    makes the syntax even more braindead.

    I don't really know Ruby, but at least it does OO righter than Java&Co (like Smalltalk, too). My language of choice these days is Common Lisp.
  15. 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 MemoryDragon · · Score: 1

      Sort of a sidecomment, if a java server needs 11 CPUs you definitely have a problem on your hand which is caused by poor program design.

      I have two java server installations here one serves around 2500 users with around 100.000 hits per month, almost no CPU cycles used, and basically running constantly without any crashes or bigger load on the database (although it uses an OODB/RDB mapper, but omits stuff like EJB, but uses a portlet engine). On the same app server around 10 other webapps with similar loads run within the same VM

      The othe one a CMS which has a handful of users, and hammers ram and the DB like no other second program I have seen. Both fulfill similar domains, but the one with the almost nil CPU load simply has a simple clean design the other one tries to access the DB via a VFS (speaking of extreme overdesign)

      Sure Java has its problems, RAM is for instance one, if you are a webhoster, I can clearly see why you hate java with a tomcat which needs a good 128MB+ for a medium sized app, but on the other hand if a webapp is well designed it is fast, and blows speedwise everything out of the water, and basically runs without crashes from day1 to infinity. I am not even talking here about clustering and other niftyness you can get out of the box.

    2. Re:Some backlash in academics as well.. by GryMor · · Score: 1

      100k per month? 2 a minute, maybe 10 a minute peek? No wonder you don't need much hardware, your load is a mere trickle. Try handling 200+ transactions per second and then tell me how many boxs you need to handle the load.

      --
      Realities just a bunch of bits.
    3. 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.

    4. Re:Some backlash in academics as well.. by MemoryDragon · · Score: 1

      You cannot do that with php and other solutions without clustering either...

    5. Re:Some backlash in academics as well.. by DrEasy · · Score: 1

      I think you need to teach both C and some clean OO language. You would use C to introduce topics such as pointers and memory management (as part of a course on data structures for example). As for OO, I would stay away from both C++ and Java, as neither really uses OO as a consistent paradigm. Smalltalk would be a good candidate, but it is not deemed "marketable" these days... I don't know much about Ruby, maybe there's potential there?

      --
      "In our tactical decisions, we are operating contrary to our strategic interest."
    6. Re:Some backlash in academics as well.. by BigZaphod · · Score: 1

      Sorry, but compared to the stuff we have running, that is a very, very small app. There's simply no comparison. :-) I'd quote numbers, but I never remember them, so I won't try just now. I realize that without numbers it doesn't mean much, but we have PHP apps that handle a greater load than the Java applications doing very similar things on less hardware with less developers and less downtime. This is just how I experience Java--and it ain't pretty.

    7. Re:Some backlash in academics as well.. by BigZaphod · · Score: 1

      I would generally agree. There should certainly be assembly in the mix, too. I'm not sure it should matter if the language is "marketable" or not to teach it in school. Not in CS, anyway. It should be about learning concepts and not about learning the language, IMO. If anything, the only part of CS that should be language related is when learning how to learn languages. With that in mind, I'd say perhaps when studying OO a course should hit C++, Java, Smalltalk, and Ruby--not just one of them. Of course I may be asking for a bit much... :-)

    8. Re:Some backlash in academics as well.. by BigZaphod · · Score: 1

      Yeah, learning the basics like memory management is essential, I think, to really "getting" CS. You don't need to know that stuff if you're just going to be a code monkey (although it helps). CS should be about more than just learning how to code.

    9. Re:Some backlash in academics as well.. by chris_mahan · · Score: 1

      Wikipedia

      --

      "Piter, too, is dead."

    10. Re:Some backlash in academics as well.. by MemoryDragon · · Score: 1

      It would be new to me that wikipedia does not cluster... There are limits where you have to start to cluster, and if you dont reach them on the app server side, you at a single point will reach them on the DB side of things.

    11. Re:Some backlash in academics as well.. by MemoryDragon · · Score: 1

      It depends really on the scope, per se, PHP is much slower than java, however, it all depends on the layers you use.

      I will give you an example: PHP4 is basically just procedural code with direct DB access embedded into a very simple templating mechanism. You can a achiev e pretty much the same in java by going towards blank jsp with direct jdbc access, you will have more speed than PHP in java that way, but you will get some small database abstraction that way. Very easy to code, but sort of verbose and no real MVC in there, which makes relayouting rather hard.

      Once you go the framework way, you will end up with much slower programs but you have a higher abstraction level. For instance, you can dump jdbc altogether and you can go the plain JDO,Hibernate route. That way you still will have a plain fast renderer for pages, but you db access will be for smaller stuff much slower, due to the higher abstraction level. But what you gain is almost total db independence that way and automatic object-table mapping in a very sophisticated manner. (Stuff which you have to do anyway, once your app becomes bigger) Then you go even further and you try to abstract the control handling, you can try to move several stuff into the AOP domain. You might end up with something like JSF, where you can start to layout pages and the page flow with visual tools but you also end up with a price you have to pay for all this higher abstraction, which in the end might make things once the application becomes bigger, more maintainable. (Like having various layouts for various customers, being able to move between oracle and postgres in a snap, not having the problem of having to maintain huge javascript graves once the customer wants sort of useful controls etc...)

      In the end it really depends on the problem domain, and how and why you end up with the stuff you use. If you just go for one technology for a certain problem because it is cool you might end up in a huge mess. A classical example is EJB, which never was really good, it hat a certain limited set of domains where you could really apply it really well, but in the end around 99% of all applications which used it, would have been better off with a simple JSP or PHP solution.

    12. Re:Some backlash in academics as well.. by chris_mahan · · Score: 1

      They squid, they farm, but there is one db.

      --

      "Piter, too, is dead."

    13. Re:Some backlash in academics as well.. by renehollan · · Score: 1
      Most commercial airline pilots never actually "fly" the plane. So, why are they there?

      In case something goes wrong.

      Even if it is more convenient to use a canned library, the person with an undergraduat academic background should be comfortable with the hows and whys of such libraries.

      --
      You could've hired me.
  16. Re:Ruby, etc.... by Casandro · · Score: 1

    Yes, there is a niche for C and that is rather high speed fixed length data-processing. But I don't know the niche for C++ yet. OK, KDE is written in C++, but otherwise I wouldn't start anything in that language, mainly because reality shows that it's hard to write programs properly in that language. New messages about buffer overflows only possible in C(++).

    Before some people complain that C is so much more efficient than all the rest. Just look at how strings are typically done in C and tell me if it's really efficient to use 1kilobyte for a string that typically is just a few bytes long, just so you won't run into buffer overflows?

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

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

  18. Re:Ruby, etc.... by KtHM · · Score: 1

    IIRC, most game programming is done in C++. I know Half Life 2 was written in C++.

  19. Re:To those who have not programmed in C++ enough. by SunFan · · Score: 1

    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)?

    Trying to answering this question tears me apart, because I so much like the _idea_ of elegant OO software design. However, I generally find that I can work my way through a C program much more quickly than a comparable-complexity C++ program.
    Perhaps it's just me.

    --
    -- Microsoft is the most expensive commodity operating system and office suite vendor in the marketplace.
  20. Re:Ruby, etc.... by fred9653 · · Score: 1

    It doesn't matter... but you can do this in C#
    System.Console.WriteLine( "HALLO!".Length );
    System.Console.WriteLine( 114.ToString("ABC{0}DEF") );
    Anyway... "USE THE RIGHT TOOL FOR THE JOB!" A device driver in Rugby? An office suite in assembler? Every language/platform has good things and bad things... and there are many intersections in their application where a developer can decide which language to use for the job.

  21. 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.

    2. Re:Id rather by MemoryDragon · · Score: 1

      Sorry to say it, but there is one domain a good OO language (and every OO language except C++ tries to cover that) has to cover extensively, and that is giving the user an extensive classlib for client server programming, which works over multiple platforms. C++ basically omitted that, and it literally took ages until they even settled for a half decent data structure classlib, one of the most basic things any OO language should deliver.

      If you compared C++ to systems like Smalltalk, Inferno, Objective C (which has this kindof thanks to the portable openstep specs), Java, C#, and even non OO systems like Oberon, face it C++ falls flat on the face, and the C++ people still up today wont admit this mistake.

      Ansi/ISO has failed hugely in this area partially vendor lockin has to be blamed there. And no a widespread adoption of C++ in embedded and various other areas is not a reason not to standardize that stuff, because if you dont want to use it, do not use it, it is as simple as that!

    3. Re:Id rather by Anthony+Liguori · · Score: 1

      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.

      I'm a C programmer by trade but use C++ a lot for various bits of research I do. I use C++ because it has some amazingly powerful constructs that no other language as popular as it has.

      As far as complexity goes, yeah, C++ is complicated, but so is Java. The other day I was forced to write a simple application in Java. I could not believe what I had to do to just trap a mouse click. I had to create an anonymous inner class that subclassed an adapter class and then had to rely on the nested class scoping semantics to dispatch to one of my own member functions.

      It was downright scary. I firmly believe Java's success was 99% marketing. I once heard Strousup comment that Sun spent 10 million on marketing Java in the first year whereas C++ entire development cost was well under a million.

      I have a shirt from Sun that says "From 0 to 2.5 million in 5 years." Languages don't just spread like that without significant driving forces.

    4. Re:Id rather by dvdeug · · Score: 1

      A computer language won't help you write better code.

      Then why doesn't everyone write in machine language? C and C++ programmers seem to go on and on about how the language doesn't matter, but it really does.

      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.

      An uncaught exception in Java will not corrupt memory and let you save a corrupt copy of a file over the good one on disk. An uncaught exception in Java will not let anyone execute arbitary code and gain unwanted access to your computer.

    5. Re:Id rather by Anonymous Coward · · Score: 0

      I had to create an anonymous inner class that subclassed an adapter class and then had to rely on the nested class scoping semantics to dispatch to one of my own member functions.

      This wasn't what you "had" to do, rather it was how you chose to implement it.

  22. Re:Ruby, etc.... by Anonymous Coward · · Score: 0

    tell me if it's really efficient to use 1kilobyte for a string that typically is just a few bytes long, just so you won't run into buffer overflows?

    I prefer to check the lengths of the input...or use a library allowing for dynamic strings. Such things are possible in C.

  23. Good point by Casandro · · Score: 1

    Honestly game programming is a good niche for C++. Games typically don't run for a long time. They work with fixed sized inputs and need to be fast.

  24. Re:Ruby, etc.... by Anonymous Coward · · Score: 0

    "Still, the real shortcomings of C aren't fixed, such as braindead syntax, only a single return value for functions (but a function can have 5 parameters; why?), lack of tailcall optimization, braindead calling conventions..."

    Uh, what's wrong with the concept x = f(a,b,c,d,e)?
    C does allow any number of parameters, but less parameters means more of them can fit into CPU registers (e.g., i0-i7 on SPARC).

  25. 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.

  26. Re:Ruby, etc.... by Casandro · · Score: 1

    Of course one must use the right tools for the job. But honestly, once you have seen Ruby, you want to do many things in it. The problem today is that programmers have no choice. Either because of company limitations, or because they just don't know of the alternatives. Programmers today only learn C(++), Visual Basic (what's that good for?) and perhaps Java or C#. They don't learn the really different languages like Prolog or Lisp. And that's where choosing the right language is important. There are problems like XML-decoding or native language parsing where you can write your programs in Prolog in just a fraction of the time needed in C or Assembler or C# or Java or whatever.

  27. 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.
  28. Re:To those who have not programmed in C++ enough. by MemoryDragon · · Score: 1

    That is a general problem, I did most of the stuff in the last years trying to cover with good OO design and patterns, but I constantly find myself in a mess of too many classes to cover a domain, functionality which is split over several classes, which are layered. Many classlibs I have seen have similar problems, due to the fact that excessive pattern usage enforces heaps and heaps of classes covering domains, which probably could be easier covered by a few hacks within a procedural domain.

    I am not against OO and patterns, in fact I lovem them, but from a maintainability standpoint they easily can become a nightmare. But that is not a problem of c++ it is a software enigneering problem per se.

  29. 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 brpr · · Score: 1

      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.

      gcc 3.0? Are you serious? That version was chock full of bugs.

      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++.

      The messiness of C++ has little or nothing to do with the "problem space". This is a really poor excuse for bad design. One of the measures of a good language is its ability to solve messy problems without the need to write messy code. One obvious example of a messy C++ (non-)feature which doesn't help to solve any problems is the reliance on header files. Watch how this destroys any hope of separate compilation when mixed with templates.

      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.

      The STL has a consistent design, but the base C++ language doesn't. Important distinction. The STL is a decent library but it was hardly revolutionary. Type-safe generics were not a new technology at the time.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    2. 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.
    3. Re:Nice troll. by brpr · · Score: 1

      The STL is part of the base C++ language. Read the Standard.

      Don't be pedantic. I meant that the basic language, i.e. the basic syntax and semantics of C++ minus any libraries/whatever, is badly designed. The STL is not, but it suffers from the underlying bad design.

      Damning with faint praise. Have you ever used the STL for more than a trivial 5,000-line app?

      Yes. It's OK but not great. It's much easier to do generic data structures in, say, Haskell. Generics feel tacked on in C++, but in Haskell/ML/etc. they're completely integrated into the language, making it natural to write pretty much every algorithm generically. In C++, you always have to make a tradeoff. Is it worth the pain of using templates just to get a little extra genericity which you might never need?

      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.

      Languages which implement generic types go back to the early to mid 1970s. ML, for example, was developed around 1973, and its type inference mechanism is far in advance of anything C++ has.

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    4. Re:Nice troll. by melatonin · · Score: 1

      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.

      Yes, 'clearly.' That always wins an argument.

      STL is a cute idea, but an abomination. I had the task of a subset of the STL. I still have nightmares about it. I know more about C++ than any man should.

      --
      Moderators should have to take a reading comprehension test.
    5. Re:Nice troll. by Anonymous Coward · · Score: 0
      One obvious example of a messy C++ (non-)feature which doesn't help to solve any problems is the reliance on header files. Watch how this destroys any hope of separate compilation when mixed with templates.
      There is a proposal before the ISO committee to significantly reduce this problem; see document N1778. And in general: if you're frustrated with C++ today, wait for C++0x. It is expected to address many (if not most) legitimate complaints.
    6. Re:Nice troll. by brpr · · Score: 1

      This is always the way though, with C++. We've been waiting more than two decades for it to become a decent language, and it's still not quite there...

      --
      Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
    7. Re:Nice troll. by jizmonkey · · Score: 1
      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".

      Haven't used C++ in a while, but don't all C++ programs "pay for" RTTI and exceptions whether they use them or not? Older compilers gave the option of turning off support for those two things because it made programs which didn't use them run faster and take up less space. Maybe modern compilers implement them in a cost-free manner.

      I think the Embedded C++ standard leaves out one or both of them for the same reason.

      --
      With great power comes great fan noise.
    8. Re:Nice troll. by rjh · · Score: 1

      Not in some time. Zero-overhead exceptions have been in GCC for a while now, and IIRC, same thing with RTTI.

    9. Re:Nice troll. by MamboKing · · Score: 1

      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.

      Not true, from page 4 of The C++ Programming language, Second Edition, by Bjarne Stroustrup.

      "The template facility was partly designed to formalize macro usage, partly inspired by the Ada generics (both their strengths and their weaknesses), and partly inspired by Clu's parameterized modules. Similarly, the C++ exception handling mechanism was partly inspired by Ada, by Clu[11], and partly by ML[26]."
    10. Re:Nice troll. by rjh · · Score: 1

      Please reread what I wrote. While C++ generics are inspired by the Ada83 generics mechanism, they're stronger than Ada83's mechanism. C++'s generics predate Ada95's strong generics.

      Ada95 has a stronger mechanism than C++, which is really impressive.

  30. Re:Ruby, etc.... by HyperChicken · · Score: 1

    Um... Sir, question: How is "Hello World".length any better than length("Hello World")? Or how is -133.abs any better than abs(-133)?

    --
    Free of Flash! Free of Flash!
  31. Re:To those who have not programmed in C++ enough. by Anonymous Coward · · Score: 0


    Yeah, one thing is that some people spend so much time trying to understand and memorize design patterns they can also not spend enough time learning the problem domain. The result is poorly applied patterns that overlap or don't really fit the problem at hand. The cure is worse than the disease.

  32. 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.

  33. Return values in C dialects by Ulrich+Hobelmann · · Score: 1

    Well, any number of parameters can go into a function, but only one can be returned. That's braindead. Python, ML, Lisp can all do better.

    If the parameters and return values are passed in registers or RAM (e.g. on the register-starved x86) is irrelevant to the question (just an implementation detail).

  34. 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.

    1. Re:High School's should teach C++ by Anonymous Coward · · Score: 0

      Sounds like you would have benefited from your high school teaching English.

      High School's should teach C++
      I'v
      eneded
      it's [CS exams]
      efficency
      probablly
      efficent
      cautius

    2. Re:High School's should teach C++ by deian · · Score: 1

      I didn't think that /. comments are to be written to impress you with their English abilities. I am not writing a paper to check what spelling errors and stupid mistakes I make while writing a comment - as long as the message is clear enough I am satisfied.

    3. Re:High School's should teach C++ by Anonymous Coward · · Score: 0

      You wouldn't give a presentation with gravy down your shirt. Why would you try to make a point (that you want others to take seriously) with such scant regard to spelling?

    4. Re:High School's should teach C++ by Anonymous Coward · · Score: 0

      Yeah, but a fine form of political argument is making your opposition look like idiots. If you make yourself look like an idiot you're really just doing the job for them. It works to automatically invalidate your argument, regardless of the logic of what is being said, because people will assume that your grasp of your premises is as strong as your grasp of English.

      And don't try to pretend a thread about C++ isn't political, eh? :)

      I agree with the GP - it is hard to argue that schools should teach C++ when your spelling is that poor. If they can't teach you to have an automatic ability to express yourself properly in the language you speak natively, what hope have they of teaching uninterested students something as complex as C++?

      Not much, I suspect.

      (p.s: I have an excellent excuse for the quality of my grammar, I stopped going to school at the age of twelve. So don't bother with that witty comeback either)

    5. Re:High School's should teach C++ by deian · · Score: 1

      I wasn't trying to make a political statement, I was just stating my opinion as if just talking to a group of friends, therefore I don't find it important to write with such care.

      If they can't teach you to have an automatic ability to express yourself properly in the language you speak natively
      I started learning english about four years ago, therefore you are assuming wrong. If you actually care to know, my English is better than a majority of the natives. In cases I find of importance I dont care to use English to the best of my abilities. I am not trying to impress anyone, I am not pretending to wear a suit - jeans and a shirt are more comfortable.

    6. Re:High School's should teach C++ by fizbin · · Score: 1
      I didn't think that /. comments are to be written to impress you with their English abilities.
      You're right, but there's a huge, huge gap between "Impressing me with your English abilities" and "Impressing me with your amazing lack of English ability". If you care so little about what you're writing to make such an egregious error in the title, why should I even bother reading it? There's spelling nits, and there are the errors found by grammar nazis, and then there's a whole other category of error so awful it makes one's teeth hurt. In that last case, the message is no longer clear because the fertilizer you've spread over your English obscures it.

      If someone were giving a policy speech and began with an analogy about the Mathematical axiom of choice relating to feminist political goals, I'd stop listening right there. It's a similar situation here. Such a blatant disregard for what's leaving one's mouth (or, in the case of slashdot posts, one's computer) shows profound disrespect for the reader that I don't care to know the rest.

      Indeed, with this post I jumped straight to the comments after the title, and so was surprised (although I admit, only slightly) to see all the other errors that the first response had pointed out. (I did this even though I find the idea of high schools teaching C++ interesting)
    7. Re:High School's should teach C++ by deian · · Score: 1

      Indeed, with this post I jumped straight to the comments after the title...I did this even though I find the idea of high schools teaching C++ interesting

      I don't personally find spelling errors a big problem when reading, unless they are very drastic. (and yes the title, "High School's should teach C++," is horrible - careless typing mistake). However, noticing that some, such as yourself, look at something(the post) with a different view when it is not properly written, I must admit, convinced me to actually pay more attention to my writing.

  35. Re:Ruby, etc.... by Ulrich+Hobelmann · · Score: 1

    Especially in C++ you would rather use string classes instead of char pointers, so buffer overflows easily disappear. People only have to make the jump, port their char pointer code to use better string functions.

    Why do you think that C strings use 1k per string? A string uses as much memory as you allocate for it. I typically use an input buffer, and when a string is completely parsed, copy it somewhere. A string of size 30 uses 30 bytes and 4 bytes for its length (or alternatively 31b for the typical C string + padding).

  36. Sometimes C++ programmers miss the point by flannelboy · · Score: 1, Informative
    OK, mod me flamebait, but I've read the same comments over and over again on Slashdot. To reiterate everything that is always said when this conversation comes up:


    C++ is faster than java / C#

    C++ has better templates

    There is so much C++ out there that no one should ever use another language, or they will be forced into reinventing the wheel

    Using a "simpler" language like java means that you will hire crappy programmers. Don't do that - use C++ and hire really good programmers.


    Having worked on Wall St. as a programmer for 15 years or so, I'm sorry to say to all the people who constantly make that argument that they are officially behind the times.


    The real reason to use java?


    Compilation times

    Compilation times

    Compilation times


    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.


    In terms of performance, that is largely a myth that is no longer true. We run pricing simulations in java (which is about as computationally intensive as it gets) and we are able to do so at the same speed is the equivalent C++ code. In fact, the java code is a bit faster now, as the tools for finding the bottlenecks are much faster.


    The hiring market? This is largely moving towards java. Many schools are not teaching C++ any more.


    The work problem? In java, you spend much more of your time working on the business problem, and much less time trying to figure out why GCC arcane error message on file X means that your template is out of whack in file Y. Or in C++, trying to locate the source of a core dump (getting java.lang.NullPointerException is SOO much better).


    Now, mod me flame.


    1. Re:Sometimes C++ programmers miss the point by rudy_wayne · · Score: 1


      +5 Flamebait.

      +6 Flambay.

    2. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0

      I ate your apple. Yum!

    3. Re:Sometimes C++ programmers miss the point by kai.chan · · Score: 1

      We run pricing simulations in java (which is about as computationally intensive as it gets) and we are able to do so at the same speed is the equivalent C++ code. In fact, the java code is a bit faster now, as the tools for finding the bottlenecks are much faster.

      Two flaws in your post. Firstly, compilation times might be important in what you do, but it certainly does not mean it is important to the majority.

      Secondly, althought your simulations between Java and C++ ran at the same speed, it is certainly not generally true -- simply because of the way Java works. To show how absurd it is to think that Java performance has the same speed as equivalent C++ code, let's consider game developers -- if they used Java to program their games, how well do you think it will run?

    4. 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.

    5. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0
      If it takes 2 hours to compile 250,000 lines of code, then you obviously haven't got a clue how to use your compiler.


      Hello dumbass, Java is still slower than C++, if it wasn't, then tell me why speed intensive software isn't written with java, but C/C++? That's right, because you're a fucking idiot, and you're wrong.

      If Java's so great, how come I don't see software written with java on shelves? (Take a look around fuckwit, there's nothing).


      We run pricing simulations in java (which is about as computationally intensive as it gets)

      Really now? So I guess tracking weather patterns and the like are simple arithmetic? Throw that at java code, and just watch it die.


      Really now, 15 years programming? I call bullshit on that.

    6. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0

      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).

      I'm sure there is plenty of room for improvement in reducing the build time for a project that size. 250,000 loc is not very big really.

      Do you know where the bottleneck is?

      Do you have a lot of template code in headers? In this case moving the template bodies out of the headers and using explicit template instantiation would help.

      Or perhaps a god class that includes everything and is included by everything else? A good old fashioned piece of refactoring would be well worth the effort here.

      Including a lot of 3rd party headers that never change? Stick them in a precompiled header so the dont need to be parsed everytime you build.

      If you are using GCC you can use tools like distcc http://distcc.samba.org/ and ccache http://ccache.samba.org/.

      If it is causing that much of a hit to your productivity. Then it is worth making the effort to improve the situation

    7. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0

      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.

      Are these build both running on the same hardware?

      2 hours for 250,000 lines seems like a very, very long time. 3 mins for 1,200,000 lines seems like a suspiciously short short time.

    8. Re:Sometimes C++ programmers miss the point by jay-be-em · · Score: 1

      You may want to look into using a compiler cache, http://www.ccache.samba.org/ is a good one.

      --
      "Orthodoxy means not thinking--not needing to think. Orthodoxy is unconsciousness." --Eric Blair
    9. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0

      I'd agree about this one.

      Where I work we've had problems with compile times. The rules for speeding up compiles are simple. If you don't need it, don't #include it, if you do need it try to forward declare it before you #include it.

      pimpl helps you avoid needing to #include.

    10. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0

      Compilation times ... GCC

      There's your problem. GCC is a slow compiler.

      I'm a big GCC fan and it has its good points, yes, but speed really isn't one of them. Most commercial compilers are quicker it, often half the time or less.

    11. Re:Sometimes C++ programmers miss the point by Anonymous Coward · · Score: 0

      If they could be bothered to whip up a decent 3D library, it would run just fine.

  37. Re:To those who have not programmed in C++ enough. by peacelife · · Score: 1
    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.
    Come on, I can't believe you said that. So wouldn't it make any difference if, say, Mozilla was in assembly?
    Just ask people how quickly they can get up to speed on OO.org, KDE, Mozilla, or GNOME
    Thats funny. Of the four you mentioned, three (OO.org, KDE, mozilla) are in C++. GNOME is in C, but they need to use too many unwieldy kludges, and hence their enthusiasm for mono.

    C++ is an extremely powerful language, but it is not a friendly one. It takes some time to grasp all its features, but the time is well worth it. For example, I am familiar with a constrained optimization program from ILOG, written in C++. It is very powerful and fast. I can't imagine in any other language. Of course, it can be implemented in any language, but not with the same ease of use.

  38. Graphics Work by Vicissidude · · Score: 1

    If you want to do any real graphics work, including games, then C++ is the only language out there. Anything else is just too damn slow.

    1. Re:Graphics Work by Casandro · · Score: 1

      Yes, it's also rather save to do graphics in C(++). However I disagree that it's the only language for such things out there. First of all, languages like Pascal or Fortran, the later mostly used on supercomputers, are often compiled by C-compilers and therefore can easily reach the same level of efficiency. However a high-level language with high-level frameworks create one serious problem: The programmer doesn't see where he does something suboptimal. For example when you are programming in Assembler, you typically know very well, when your program is running occupying floating-point units or staying in fixed point. In some languages that's hard to judge. Furthermore 3d-engines now are made to support arbitrary geometries, even though the game won't need them. In previous times, before 3d-accelerator boards became widely avaliable, the coder tried it's best to match the graphics with the technical possibilities to get as good as possible graphics with the little CPU-time it had. If you look at old games from the early till mid 90s you will be impressed how much they got out of those little CPUs. It's really a shame when I see a variation of the "turning torus" demo on a modern PC "only" doing 200 fps with accelerated graphics, when my 486 could already do the same demo with 60fps.

    2. Re:Graphics Work by BigZaphod · · Score: 1

      Of course the modern PC is probably doing that spinning torus in a far, far higher resolution than your 486 was...

    3. Re:Graphics Work by Vicissidude · · Score: 1

      Good luck finding any graphics programmers still using Pascal or Fortran. I'm sure you can find some old hackers, but very few people are learning those languages any more.

      As for using assembly language for graphics programming, that's only practical for very small programs now when efficiency or size is paramount. Any graphics programs of moderate size are highly complex. There is little need to spend the time and effort to program in assembly when you can get something working in C++ in a fraction of the time.

    4. Re:Graphics Work by MrResistor · · Score: 1

      Another area where C/C++ win, IMO. How many other languages can you embed hand-optimized assembly in directly?

      --
      Under capitalism man exploits man. Under communism it's the other way around.
  39. Re:Ruby, etc.... by Casandro · · Score: 1

    >Um... Sir, question: How is "Hello World".length
    >any better than length("Hello World")? Or how is
    >-133.abs any better than abs(-133)?

    Good question. The point is, that everything is an object, numbers, lists, even program blocks are objects. Therefore, for example, it's rather simple to make iterative functions. You just pass a program block as a parameter to a message and the method can then call that parameter. (I might have gotten the terminology wrong.) Best of all it's all done in a clean form.

    Then there are things like lists of all the object-instances in your program. You can iterate over it, find the type of each one, no matter if it's an integer or an object reflecting a large database. You can then find out more about that object, even if it didn't exist when you were programming that part of code.

    Of course that's also theoretically possible with C(++), but there it involves doing a lot of dirty stuff like shifting pointers to get arbitrary access to your programm's memory. In Ruby it's all nice and clean. The -123.abs is just a consequence of it. I mean there are no procedures or functions anymore. It's all in the objects. And everything is an object.

  40. Consider alternatives! by Anonymous Coward · · Score: 0

    If you want code that is clear and well organized I'd suggest you leave the C/C++ area completely. They are (together with Perl) famous for redundancy and obfuscation. The expressiveness of C is not that good and it is much too easy to harm yourself with it. Bigger C-projects are not very maintable, or if they are then *even though* they are C-projects. What C++ gained in expressiveness it also gained in obfuscation.

    <advertisement>
    The language is very baroque and while I'd say that RAII is a definate achievement it does not justify the use of C++. If you aim for high quality, maintable programs I would recommend to use Ada95. It is expressive, has threading primites built in, excellent embedded and realtime support, generics, exceptions, fixed-point precission, ...
    Do yourself a favour and visit http://www.gnat.com or http://www.adaic.org to learn more.
    </advertisment>

  41. Language Just A Tool by Vicissidude · · Score: 1

    I think a lot of people in this discussion are missing the point. C++ and Java are just tools for learning and doing computer science. The whole point of a degree program is not to learn how to program, but to learn the theories and ideas of development. Learning to program is a side-effect.

    Tools like C++ and Java will age and eventually get replaced. You'll need to learn a new language next year and something else the year after that. The theories and ideas learned in CS courses will last you a lifetime. That is why people without degrees have serious gaps in their knowledge and what makes the degree so powerful in the first place.

    1. Re:Language Just A Tool by Anonymous Coward · · Score: 0

      Way to show your elitism. Somehow the fact that people without college degrees understand formal languages and computability theory escapes you.

    2. Re:Language Just A Tool by Vicissidude · · Score: 1

      People without a CS degree are literally ignorant in certain sections of computer science. Certainly, some people may be able on their own to get the same broad and deep knowledge that a CS degreee provides. However, a potential employer would never know if you have covered all the topics that a degree program covers. It's unlikely that you would know either.

  42. Re:Ruby, etc.... by Casandro · · Score: 1

    Well the problem here is between reality and the ideal. Of course one could use the better string functions, but (almost) daily reports about buffer overruns tell another story. In classical C programmers probably tend to oversize their strings instead of properly sizing them. It's just less work and you are on the save size.

  43. Re:Ruby, etc.... by Anonymous Coward · · Score: 0

    So whitespace is objects too? Waste of resources, I say!

  44. 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.

  45. std::string by Anonymous+Brave+Guy · · Score: 1
    out of interest, what's wrong with std::string?

    A fairer question might be what's right about it. ;-)

    Seriously, the string-handling in standard C++ suffers horribly from design-by-committee.

    To give the most obvious example, there's no way to write a literal std::string, which in turn means that basic syntax like "a"+"b" doesn't work, even though the + operator is used to concatenate std::string objects.

    There are also glaring inconsistencies in usage, because of all the history using char*, and then numerous class libraries inventing their own string type. Take a look at the I/O streams interfaces in C++: you can't even pass a std::string as a filename without converting to a C-style string first.

    Then there's the interface, which is a bit Jack-of-all-trades, and bloated with it.

    And of course, even with a real string type now -- surely a prerequisite for claiming any meaningful string support at all! -- C++ still doesn't provide standard support for basic string processing using regular expressions. Compared to a more text-focussed language like Perl, well, there's no comparison.

    Fortunately, a number of these sillies are in line to be fixed in the next revision of C++, but for now, the language's string support is pretty much a joke.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  46. 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.
    1. Re:Multi-language approaches by DavidNWelton · · Score: 1

      It depends on the project of course, but my experience is that scripting languages are always going to "scale down" better than c++, and so will be able to more quickly bring something functional on line.

      You are of course correct that learning the scripting language and the low level language isn't free, but learning the scripting language is within reach of more people, and for someone who knows the low level language, the scripting language might take longer than a week, but won't be that hard.

  47. Welcome back! by Anonymous Coward · · Score: 0

    Dear C++ Returnee,

    Welcome back! Let me assure you, the reasons you have left C++ in the first place are still present and awaiting your command.

  48. Re:To those who have not programmed in C++ enough. by Anonymous+Brave+Guy · · Score: 1
    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)?

    That's a slightly loaded question, don't you think? ;-)

    Any high-level design tools are a double-edged sword. When used well, they allow you to express designs more simply and clearly. When used poorly, they simply add another layer of complication onto whatever you had anyway. You can do this in any language that offers such tools.

    FWIW, I've found that often the languages where you couldn't write obfuscated code if you really wanted to also lack the power to express clean designs cleanly as well. IMHO, this is one of the biggest problems with C++'s "successors" C# and, particularly, Java.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  49. Re:Ruby, etc.... by Anonymous+Brave+Guy · · Score: 1
    Just look at Ruby, a completely object-based language.

    Mistake number one...

    You can do thinks like "Hello World".length, or -113.abs .

    And how is this an advantage over

    length "Hello World"
    or even
    strlen("Hello World")
    in real life? Do you often find yourself taking the length of a string literal in real code anyway?
    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.

    It does, however, have the practicality you need for a lot of real work. I write C++ code that works with complex graph-like data structures for a living, and we use pointers all the time. Expressing the same structures, with the same fine control of data size (which matters when your graphs can easily have millions of nodes) would be more difficult in languages that obscure the concept.

    And [Ruby] is even clean at that.

    OK, I confess: I've looked into Ruby seriously twice, and found it awkward and unnatural both times. I've programmed a lot of different languages in my time, from assembler and C to C++ and Java to Perl and Python to OCaml and Haskell. I've never seen a language that tries as hard to force the programmer into its mindset, rather than trying to provide tools for the programmer to express their intent, as Ruby does.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  50. Re:Ruby, etc.... by Anonymous Coward · · Score: 0

    Actually, I parse -133.abs as -(133.abs), which is totally pointless. Perhaps the grandparent meant (-133).abs; however I still think that is pointless as well -- why not just omit the minus sign?

    Seriously though, constants should only be defined once per program. Otherwise, you're likely to forget one when you redefine the value of the constant. Or worse: you may never have the same values in the first place.

  51. Licensing C++ by Anonymous Coward · · Score: 0

    But can Bjarne afford a C++ license from the SCO group, owners of the C++ programming language?

  52. The D Programming Language by WalterBright · · Score: 1

    takes the features of C++, and reengineers them so that one has the power and efficiency of C++, but with fast compilation, true modules, automatic memory management, cleaned up syntax, etc. http://www.digitalmars.com/d/

    For performance of D, see http://shootout.alioth.debian.org/great/benchmark. php?test=all&lang=all&sort=fullcpu

    1. Re:The D Programming Language by Anonymous Coward · · Score: 0

      Quoting from "The Shootout": "And remember, languages that implement more benchmarks will move to the top of the list, and those with many missing benchmarks will stay at the bottom!"

      Considering that D is missing 0 benchmarks and the next ranks between 2 and 8 I wouldn't bet on D as staying #1 for a long time ;-)

      But anyway congratulations to your implementation work!

    2. Re:The D Programming Language by Leimy · · Score: 1

      Yeah, I've been meaning to take a good look at D for a long time. If anything can evolve C++ in the ways I think it might need to in the future, it's D.

      Simple problem is that I've been hobbying with functional languages in my spare time lately and D just doesn't appear to be available on all the platforms I'd like to use it on.

      How difficult would it be to get D on Mono? That might help get people into it.

    3. Re:The D Programming Language by Anonymous Coward · · Score: 0

      ... or C#, or Java.

      It's been done before, and many many languages have unimaginatively been called 'D'. They need some serious weight behind them to get noticed and this doesn't have it.

    4. Re:The D Programming Language by Hortensia+Patel · · Score: 1

      I took another look at D recently (the first for about a year) and was very impressed by how far it has come on. Templates in particular appear to be both significantly more flexible and significantly simpler than in C++, which is no mean feat.

      That said, I do think your assertion that "one has the power and efficiency of C++" is a little disingenous, given that D doesn't support RAII very well. If I had to name a unique selling point for C++, RAII would be it. Deterministic behaviour is a huge deal to a lot of C++ users, and I suspect that trying to achieve it in a GC language is going to be like crawling uphill over broken glass.

      P.S. Do you know if there's a yacc/ANTLR/similar grammar for D kicking around anywhere?

  53. Re:To those who have not programmed in C++ enough. by SunFan · · Score: 1

    So wouldn't it make any difference if, say, Mozilla was in assembly?

    No one really considers assembly an applications programming language, any more, except perhaps HPC/graphics developers.

    Of the four you mentioned, three (OO.org, KDE, mozilla) are in C++. GNOME is in C...

    Yes, but they are all difficult to work with. That's just a fact of all projects that large, IMO. If it isn't a problem with C kludges, then its a problem with choice of abstraction or a problem with 100 shared libraries or a problem with poor performance or a problem with compiler interoperability, etc. C++ doesn't make these problems go away.

    --
    -- Microsoft is the most expensive commodity operating system and office suite vendor in the marketplace.
  54. Re:To those who have not programmed in C++ enough. by SunFan · · Score: 1

    That's a slightly loaded question, don't you think? ;-)

    Yes, but I think it is a valid one. At this stage of software technology, I just don't think there are _any_ good solutions for writing large, portable, comprehensible, etc. programs. Even the beauty of Lisp comes with baggage that keeps it from being used more widely. C++ is no panacea, either.

    --
    -- Microsoft is the most expensive commodity operating system and office suite vendor in the marketplace.
  55. 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
  56. Re:To those who have not programmed in C++ enough. by Dixie_Flatline · · Score: 1

    This is unreasonable. Do you know WHY template programming is so powerful? It's because the template system is a fully functional programming language in and of itself. It's like a scripting language tacked on to the back of another language. It damn well better be better than anything else out there.

    It would be like pairing Java and Python together. Absurdly powerful, but there's a lot of programmer-time overhead in learning and using the systems properly together.

  57. 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.
  58. Excuse me... by COBOL/MVS · · Score: 1

    C++ doesn't have a 'propaganda campaign.'

    What do you call this article & discussion thread then?

    --
    GOBACK.
  59. You do have a point by Anonymous Coward · · Score: 0

    The binary compatibility of C++ object files sucks when face with slight changes to classes. I wonder if GCC 4.0 can use the new -findirect-dispatch flag to make C++ code more resiliant to the brittle class problem that plagues C++ and that Java handles so well. i.e., you can add new data members and methods to any Java class and not affect how other classes make use of it. This is due to Java's late-binding. C++ desperately needs this feature. Perhaps it will be added in C++0x as a side effect of adding introspection. I hope so, anyway. C++ needs better runtime dynamic features to compete with Java and Python.

  60. Didn't take me long to get into KDE development. by bluGill · · Score: 1

    I can't speak for the rest, but it didn't take me long to get into KDE development. KDE is designed well enough that I don't need to know the entire project to work on it. I've submitted a couple patches here and there. I've never looked at 99% of the source code, but I don't need to, since I can quickly find the area of code I'm interested in for the patch, fix it, test and submit.

    Now KDE does need some experts who understand the entire thing, to make sure I'm not adding something that should be done elsewhere. However a good programmer should be able to jump in and fix things.

  61. Exactly by Casandro · · Score: 1

    Yes, true. You can do graphics works efficiently in C++. But just look at the other things people do in C(++). They write Webservers in C. Programs which deal a lot with strings, where security is a lot more important than efficiency. A Webserver written in, lets say, Ruby might consume 5 times the CPU-cycles, but it's most likely free from any nasty buffer overruns. At graphics work that's irrelevant. You just have your frame and work with it. When dealing with vector graphics it's more difficult, but even then one rarely has to fill arrays with variable length of data.

    1. Re:Exactly by MrResistor · · Score: 1

      People write webservers in C(++) because what's more important than security is optimal use of available resources. Poor security isn't a tangible cost. Number of CPUs, amount of RAM required, rackspace, power, HVAC... all of these ARE tangible costs.

      "5 times the CPU cycles" to me says you need 5 times the hardware to support the same number of users. Think you can justify that to the guy determining your department's budget?

      --
      Under capitalism man exploits man. Under communism it's the other way around.
  62. Re:Ruby, etc.... by Casandro · · Score: 1

    > OK, I confess: I've looked into Ruby seriously
    > twice, and found it awkward and unnatural both
    > times. I've programmed a lot of different
    > languages in my time, from assembler and C to
    > C++ and Java to Perl and Python to OCaml and
    > Haskell. I've never seen a language that tries
    > as hard to force the programmer into its
    > mindset, rather than trying to provide tools
    > for the programmer to express their intent, as
    > Ruby does.

    Well it probably depends on where you come from. I do not really believe that something like x=y==z?23:42 is really natural. One problem I see with C is that one can use it, just like Assembler. You can write everything in any style in it. You can ignore everything the language provides. Then there are obvious paradigm shifts. For example C claims to be a structured language with little need for goto. Instead the case-statement is nothing more than on x goto in BASIC.
    C in fact forces it's thinking on the programmer in a really bad way. If you don't follow the rules, you will not be punished immediately, the compiler will compile without any problems, but the program will behave in strange ways, impossible to understand by someone not intimately familiar with the whole system. If you do not completely follow the rules, you can write a "hello-world" program which seems to work perfectly fine in all your tests, but once someone has a long awkward name, consisting out of some binary characters, it will start to execute arbitrary code. Now don't say this never happens in real life. It does, on a daily base. Windows XP, for example contains such a bug. Connect it to the internet for longer than half an hour (or shorter if your connection is fast), and a buffer overflow will happen.

  63. wxWidgets & STL by Anonymous Coward · · Score: 0

    Cross-platform, flexible, powerful?

    C++ is the most effecient language that exists. Check out the flipcode articles on template optimization of vector class implementation (Vector ala 3-space)

    You are right about the multiple library integration approach has some downfalls. However that adds to the approach too... if you rely on one type of library you can always integrate it using your style and just inherit some of the classes or use containment. And if you don't like one library, swap it out for another.

    You can do a lot with wxWidgets and that is one library under one roof

  64. 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
  65. Re:Ruby, etc.... by Anonymous Coward · · Score: 0

    x=((y==z)?23:42) already looks a lot clearer, but you've got a point...

  66. (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.

  67. OT: the TIOBE survey and .NET in trouble by Latent+Heat · · Score: 1
    I guess the TIOBE survey has to be run through the filter that it may reflect what PHB's think they want to hire people for, but it is one of the few public data points we have.

    What I find interesting is that Delphi is roaring back, and it is not just a temporary blip caused by the new Delphi 2005. My guess is its not so much that people love Pascal but some big problem with Microsoft's .NET and their stand on Visual Basic 6.

    If you want to do what Visual Basic 6 used to do (and still does, thank you), which is support plain-old-Windows without the .NET layers, and do it in a VB sort of way with forms and widgets and property editors, it seems that Delphi has become the only game in town (although I should look into RealBasic). Yes, there are the legacy/spaghetti VB apps, and yes, there are VB coders who don't want to learn, but I think MS is missing the boat. It is not that people don't want to learn VB.NET: what they want is a VBish thing for the old Win32 API without the .NET layer, and they are willing to learn a new language to get it. The problem is not so much with VB.NET as it is with just plain .NET.

    1. Re:OT: the TIOBE survey and .NET in trouble by Anonymous+Conrad · · Score: 1

      what they want is a VBish thing for the old Win32 API without the .NET layer, and they are willing to learn a new language to get it

      Why? What's wrong with the .NET layer? It's a VB-like environment. OK, VB.NET gets strong typing but that (IMO) is a good thing. Doesn't Delphi have that too? .NET works on everything but Win95 and the general acceptance level is rising.

      Remember that moving to Delphi also has the "buy a new tool" hurdle. If you want non-.NET, non-VB RAD for Win32 your best bet is VC++/MFC, and chances are VB coders will already own VC++ with visual studio.

      No, I'm not kidding. I'm one of the few that learned to use MFC rather than prejudging it :-p

    2. Re:OT: the TIOBE survey and .NET in trouble by Latent+Heat · · Score: 1
      What's wrong with the .NET layer? Dunno -- the download for the target machine or having to distribute the .NET runtime with your app, features from the Win32 API missing from .NET. For example, Matlab makes a big deal that they can interoperate with all of the component software standards out there -- they do ActiveX, they do Java and recently they do Java widgets in Matlab figure windows. Do they do .NET widgets? Nope. Really don't know what is wrong with the .NET runtime, but I just kind of get this feeling that it hasn't caught fire, and if Microsoft has such confidence in it, why is it a download rather than coming pre-installed from Dell?

      As to VC++/MFC being a substitute for Visual Basic, MFC may be a fine, fine framework and a great use of the features of C++, but it isn't even close in the VBish RAD department. The old Visual J++ was a Visual Basic substitute; VB.NET and C# are definitely VBishly RAD, although on the .NET runtime.

      Delphi is a "buy a new tool" as well as a new language, but if you are developing for Win32 and using the Form Designer and a little bit of Pascal to glue things together, it is a pretty good VB replacement.

  68. Re:Ruby, etc.... by MrResistor · · Score: 1

    I have a hard time blaming the language when the real problem is the developers not using its features.

    --
    Under capitalism man exploits man. Under communism it's the other way around.
  69. Just needs some more class frameworks by Anonymous Coward · · Score: 0
    I like C++, it has changed a lot over the last decade and it's not the same language everybody rags on.


    Really, the biggest limitation is that there aren't as many class frameworks and they aren't as rich as they are in Java. Boost is doing some cool stuff, in corporate the in to the standard. Some classes to make it more network centric would be nice also.

  70. Re:Ruby, etc.... by Casandro · · Score: 1

    Well the main problem with C(++) is that it forgets one fundamental property of all humans, they are lazy and want to do as little as possible.

    It's amazing, but many/most libraries in C(++) are harder to use than doing things directly. In other languages, it's the other way round. Libraries are just trivially simple to use.

  71. Webservers need resources? by Casandro · · Score: 1

    I've never seen a Webserver without dynamic content that actually uses more than a few percent of even the slowest server. A webserver just needs to shovel around data. There's little intelligence in it.

    When webservers are slow, it's either because of the slow network connection, or because of slow dynamic content. There are people out there running gigantic sites on interpreted scripts. Slashdot, for example seems to run on Perl. Wikipedia runs on PHP, other sites run on Java or even ASP.

    If speed would be a serious issue, there would be no ASP, there would be no PHP and Java would never have found it's way onto servers.

    The speed of the http-deamon itself is rather unimportant as it only needs to move data around. A shell-scripted webserver will only be unnoticably slower than one coded in C, or even assembler.

    1. Re:Webservers need resources? by MrResistor · · Score: 1

      Well, that's not my domain of expertise, so I'll have to take your word for it.

      However, that doesn't quite jive with what has filtered into my brain on the subject over the years, so I'm not convinced that my point has been invalidated. Though, I might be if you can explain in that context why servers seem to need to have such beefy specs.

      Clearly, that power is needed for something. Just because it isn't the webserver itself that's using it doesn't mean the webserver should be allowed to take 5 times more than it needs.

      --
      Under capitalism man exploits man. Under communism it's the other way around.
    2. Re:Webservers need resources? by Casandro · · Score: 1

      Well of course wasting CPU-cycles is a bad thing, but in this case we gain something more important: Security.

      Looking back into the past, servers haven't been to beefy at all. When I started commercial programming at a company, the slowest machine was the server. That was a 486 with 66 Mhz running Novel. Nevertheless it was able to saturate our 10MBit network.
      Static file/web serving is by no means CPU-intensive at all. In fact, with modern hardware you have a feature called "zero copy server" which basically means that the harddisk controller is able to put some data into memory, and the network controller can take it from right there. With that, you can saturate a gigabit network connection with just a 486.

      Another interresting point is that one can even do powerfull calculations, even on a high level system. For example the LISP-Machines completely ran on a LISP-based OS with applications written in LISP and a LISP shell, and so on. Those machines were used for 3d graphics for TV-stations during the 80s.

  72. Re:Ruby, etc.... by MrResistor · · Score: 1

    It's amazing, but many/most libraries in C(++) are harder to use than doing things directly.

    You clearly haven't spent much time working with assembly. You couldn't be more wrong if you tried.

    --
    Under capitalism man exploits man. Under communism it's the other way around.
  73. C++ allows code reuse !? by hritcu · · Score: 1

    C lets you shoot yourself in the foot rather easily. C++ allows you to reuse the bullet!

    --
    If you don't fail at least 90 percent of the time, you're not aiming high enough. (Alan Kay)
    1. Re:C++ allows code reuse !? by LinuxBretz · · Score: 1

      I dunno how to scrore your comment as "really funny" - I find your joke really "cute" -- but it is okay within the "funny" context.

      Shoot on our foot means that WE do shoot our self - Not the C/C++ language... That is why high-level java, .NET or other scripting tech is called "Idiot-proof" programming language :-)

      --
      I am a Linux newbie; C/C++ newbie since 7 years; I feel so much alone without my feu Amiga 500
  74. Gotta love Slashdot... by Anonymous Coward · · Score: 0

    where professing ignorance gets you called insightful.

  75. asserts by webhat · · Score: 1
    ... Stroustrup asserts that C++ was also used.


    I do hope they removed the asserts.
    --
    'I am become Shiva, destroyer of worlds'
  76. You have plagiarized me. by Anonymous Coward · · Score: 0

    Please have CuminherTaco forward the moderation score to my many accounts. Thanks!

    Yours in Christ,
    <i>eSolutions</i>

  77. Re:To those who have not programmed in C++ enough. by Ed+Avis · · Score: 1

    I don't accept the premise of your question - you are offering a choice between 'simple' and 'elegant' but in reality they are the same thing. The only purpose of using object-oriented programming or any other technique is to make the program simpler and easier to understand. If it just obfuscates the code, then the feature has been misused.

    Maybe you're being too hard on yourself and the 'comparable-complexity C++ program' you find hard to understand is just an overengineered mess. It can happen in any language but some languages make it easier than others, if the programmer lacks the self-discipline to keep it simple.

    --
    -- Ed Avis ed@membled.com
  78. Re:To those who have not programmed in C++ enough. by Ed+Avis · · Score: 1

    I should correct myself: there is another good reason to use a language feature and that is to help the compiler catch mistakes. A C++ program written using templates may be a little more complex than one using void* pointers everywhere and casting at run time, but it's less likely to have some kinds of bug. (At least, if you are a bad enough programmer to need all the help you can get from the machine - I know I am.)

    --
    -- Ed Avis ed@membled.com
  79. Re:Ruby, etc.... by gsasha · · Score: 1

    Good you don't quote off the IOCCC. So C/C++ allows unnatural writing style. But you don't *have* to write that way.
    DISCLAIMER: I've never written one line in Ruby, so I cannot comment on that.

  80. Re:Ruby, etc.... by Casandro · · Score: 1

    Well some time ago, there was a story about someone using RFID tags to store sid-tunes. They also had the code online for accessing such RFID chips. It was easy to understand, even for a non Ruby programmer.

  81. Re:Ruby, etc.... by LinuxBretz · · Score: 1


    CODE:
    0000 1010 1110 1001
    END CODE
    == binary direct CPU addressing natural language: I saw people analyzing fullscreen of those strange numeric signs for debug purposes ... ( year 1986 at computer science class )

    CODE:
    lda #10
    ldx (200)
    jsr ffd2
    ENDCODE
    == Wow! more human readable mnemonics assembly code.

    CODE:
    #include

    int main(...){
    printf("Hello world!\n");
    return 0;
    }
    == Ooh! It is called "C" language and it is a high-level assenbly language :-)

    CODE:
    Program Learning_To_program_At_school;
    uses System;...etc...

    Type ...
    End;

    Var I:integer;

    Procedure blah;
    Begin ...
    End;

    Begin .....;
    End.
    == Hello I am called PASCAL and I am here to teach you to - how to program, and also to teach you some programming disciplines in that you will not be able to mix types as "C" does ...

    CODE:
    #include

    class I_am_an_esoteric_class{
    public:
    I_am_an_esoteric_class();
    virtual ~I_am_an_esoteric_class();
    virtual a_method()=0; // abstraction...
    }; etc...etc...
    ENDCODE
    == Hey my spritual brother, I am a new borned from high-vibration space etheral language based on "C" and in this new-age world beginning, I come from a dream of a real magic and totally polymophic memory space called Object-Oriented Programing and esotherism. ( I know there were already other kind of same worlds before me...)

    CODE:
    import L1.L2.L3.L4.L5.L6.L7.L8.L9.L0; ...
    class Main...blah BLAH{ ...

    --
    I am a Linux newbie; C/C++ newbie since 7 years; I feel so much alone without my feu Amiga 500
  82. Re:Ruby, etc.... by LinuxBretz · · Score: 1

    Arrg! by mistake I submitted my unfinished text!!!

    Here it is and the above blah blah was only to say and bring this point according to my believe:

    okay, java code ends here...
    and All other higher-level language are not PROGRAMING languages but certainly SCRIPTING LANGUAGES!!!
    Btw, In what language those SCRIPTING language was built from ????? hmmm???
    C/C++/or even assembly language!!!!
    So you guys saying you are programmers when you put stuff like Ruby, Visual Basic, Java, Python, Perl, PHP, etc...etc... You're WRONG...You are SCRIPTERS not PROGRAMMERS....Unless you know and were used to program using those "arcane C/C++ languages- as you say ...

    ouf!!! I feel better now...Sorry I am really pissedoff when I see people talking about programming when in fact they SCRIPT with really big business words!!!!!

    Scripting is really necessary for quick and fast config and interfacing programs...And installing Linux or even M$-Window$.

    hummm... I am a dead man I know....

    --
    I am a Linux newbie; C/C++ newbie since 7 years; I feel so much alone without my feu Amiga 500
  83. Re:Ruby, etc.... by Casandro · · Score: 1

    > So you guys saying you are programmers when you
    > put stuff like Ruby, Visual Basic, Java,
    > Python, Perl, PHP, etc...etc... You're
    > WRONG...You are SCRIPTERS not
    > PROGRAMMERS....Unless you know and were used to
    > program using those "arcane C/C++ languages- as
    > you say ...

    There is little difference. In fact, Ruby compilers are probably already written in Ruby. And I have written quite some code in C and Pascal.

    And besides, if a little shell script does the same, a gigantic C program, why should I do it in C?

  84. Re:Ruby, etc.... by Anonymous Coward · · Score: 0

    "constants should only be defined once per program"

    Ri-i-ight. You're probably one of those people who put "const int ZERO = 0;" (or, worse, "#define ZERO 0") in a generic include file called "misc.h", right?

  85. Re:Ruby, etc.... by LinuxBretz · · Score: 1

    Hi, it was 02:34 AM in the morning and I was a bit upset and very tired from other duites. But What I've writte in, if a bit loudly, was my believe as I said.

    Indeed I use scripting tools - all the ones I named in my crazy comments (...). PHP, bash, javaScript/java...
    I did not want to say that scripting is bad, I was reacting very loudly and angry against people who says C/C++ should be dead.... Those people cannot be aware of that all higher-level of beautyfull and powerfull and idiot proof programming languages are in fact directly built from C/C++, or even assembly language... BTW are the assembly mnemonic langauges shall be killed ??? -- NO and NO for C/C++.

    Scripting is a level of programming that it is NOT the same level of ASM, C/C++/PASCAL native machine-code compiled languages.
    I name it "SCRIPTING" not "programming at the level of C/C++....

    I was used to fireup Borland Turbo C/C++ (2.x/3.x) In the DOS world before linux and Winblows and residential internet time. I wrote a BBS terminal client to connect and use those BBS through telephone-line modem ( 2400bps and 14400 bbs ) and had to hardcore program interrupts and speak to the UART dev to break that stupid DOS console 9600 bps max in the bios.

    In the linux slackware 3.4 time I wrote a big custom real-time monitoring software to monitor real-time transaction @work - in C/C++ and my own "scripting" language to configure and setup the transaction data directives at runtime...etc...etc...blah...blah
    Other guys @work tried to use TCL/TK, JAVA, etc to achieve my goal without success and it was something really funny to see those scripting not doing 1% of what my project did... Thus, when really specialized stuff and speed is needed, NO scripted languages can be considered...

    So there are Programmers, and Scripters :-) hahaha

    Long live to REAL C/C++ programmers!
    cheers!

    --
    I am a Linux newbie; C/C++ newbie since 7 years; I feel so much alone without my feu Amiga 500
  86. C/C++ should have been always the choice by LinuxBretz · · Score: 1

    ( warning: my low-english skills may be funny :-)

    I am used to speak, write, and think in C and C++ since year 1994, the year I've got to go serious in programming...

    For those who are borned after the arcane MS-DOS-only home computers:

    The C++ language is a really tough language to learn and master ( templates features: I begun to use it only since last year! ) and the C language learning curve and master is very necessary before going to C++, in my opinion, contrary of people telling that C is not required to go C++ in term of syntax and lexxical mastering. In the history of C, it was told that C is an high-level assembly language and still it is more true today - indeed, because the algo-engines generate better assembly algorithms than human brain...

    -As I told in an angry reply ( Ruby sub-topic ), All those high-level - high-end - idiot proof scripting languages are ALL built from something at lower-level engines - speaking of programming language - : C/C++/Pascasl or any compiled-into-native-machine-code-cpu-binary instruction sets!!!
    Lets call it "Technology-level layers"...
    Thus at least the famous or infamous JAVA technologies are built from C or C++ ( really I dunno but certainly not Assembly language...).

    And so for the other scripting techs.

    -High-end level of "technology-level layers" such as Java, Perl, Python C#.NET etc...
    implements grouped lower-level layers instructions to form that high-end and complex business technology. Writing it in C/C++ or any other compiled language maybe hard and long and very skilled programmers requiered.

    -Compiled languages should not be "cross-platform" because the results are the same as high-level languages: Slow and overhead calls of low-level instructions sets...

    - In term of security, it is always the responsibilities of the programmers and their project-leaders- not - the technologies. No one can rely on pre-built packages for security from one generic context to a different specific, specialized-and-very-sensible context.

    Really, the C/C++ language technology cannot be killed because it will always be requiered to perform extentions to the higher-level scripting -or pseudo-compiled languages. It is very stupid to think that C/C++ is no more needed as it is the base of most of the high-end layers.

    As Java and .NET extends itself within its own layer-level, it is consuming more resources and getting bigger and f%^& slow and buggy. This is very dangerous - but the Power-Corporations refuse to PAY REAL DEEP-SKILLED PROGRAMMERS to secure and optimize their business techs at the level of C/C++. if those deep-skilled people are very rare in the world, it is because of JAVA. Not to talk about Microsoft deadly cupid+capitalist brain-hidding technologies (sorry, I had to say this:-).

    For the small business compagnies that cannot afford deep-skilled people, there is no real solutions other than those scripting technologies...which are really good in small contexts - really.

    And no - I am far from beiing a deep-skilled programmer, but I see what I see and I am scared of what is coming in the future....

    Long-live to C/C++

    --
    I am a Linux newbie; C/C++ newbie since 7 years; I feel so much alone without my feu Amiga 500
  87. "Evolution" is a good thing! by Coder+Dad · · Score: 1

    Java was born (and continues to develop) with the benefits of the "lessons learned" from its forefathers (C, C++, Tcl!). Assertions were deemed a good thing from the C++ crowd, and -- VOILA! -- now assertions are now a part of the Java language.

    Don't fight evolution. Resistance is futile. Put the pointer down -- nice and easy like.

    Mr. Java Zealot

    --
    "The mere imparting of information is not education." --CGW
    1. Re:"Evolution" is a good thing! by pauljlucas · · Score: 1
      Java was born (and continues to develop) with the benefits of the "lessons learned" from its forefathers (C, C++, Tcl!)
      Then Java is a slow learner since many of the new features of Java 1.5 (enums, generics) have been around in other programming languages for decades going back to languages like Ada. And even Java 1.5 is still missing useful features of other languages. Java is still one of the few languages that has added nothing new to the body of computer science and language design.
      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    2. Re:"Evolution" is a good thing! by Coder+Dad · · Score: 1

      There are plenty of pros and cons to the JCP (Java Community Process). Being "slow" is definitely one of the cons. The reality is that Java (nor any other language) is going to be everything to everyone.

      As a web and enterprise app developer, I have no other viable options (and I'm including .NET). However, if you're doing socket programming to get legacy apps to communicate in real-time, then Java MAY not be for you.

      Java is still one of the few languages that has added nothing new to the body of computer science and language design.

      I'd have to disagree. "Java" is MUCH more than its core language syntax. It's also a framework which supports a compendium of practical APIs. When Ada is able to permeate the mobile, embedded, distributed, web, and enterprise app domains, we can continue this discussion!

      --
      "The mere imparting of information is not education." --CGW
    3. Re:"Evolution" is a good thing! by pauljlucas · · Score: 1
      "Java" is MUCH more than its core language syntax. It's also a framework which supports a compendium of practical APIs.
      Qt predates Java and works in mobile devices. Like I said, Java has added nothing new. (Being popular doesn't count.)
      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.