Slashdot Mirror


Standard C++ Moves Beyond Vapor

An Anonymous Coward++ writes "This google thread announces the first C++ compiler that can actually handle the whole language (we'd been waiting for half a decade here). The company that did it is EDG. They're a tiny outfit, but they're apparently also behind the Intel compiler (both on Windows with Visual C++ extensions, and on Linux with GCC extensions). There are rumors they can compile the Linux kernel too."

385 comments

  1. My word! by Anonymous Coward · · Score: 0

    Give it another ten years, and we might have some C compilers that implement all of C99!

    1. Re:My word! by Daveed_V · · Score: 1

      Our front end (EDG) also implements all of C99 (it has for over a year). I believe Dinkumware has a matching library.

  2. 10? by sean23007 · · Score: 3, Funny

    This includes the first C++ compiler that fully implements the 1998 ISO/ANSI C++ standard (including "export")

    1998. Ten years, eh? Oh wait- what year is it again?

    --

    Lack of eloquence does not denote lack of intelligence, though they often coincide.
    1. Re:10? by sean23007 · · Score: 2

      ignore that. the guy at the computer next to me read it to me and either i misinterpreted him or he misspoke. damn it.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    2. Re:10? by BryceH · · Score: 1, Flamebait

      the worst part is its moded up :) moderators apparently dont read _at least_ the headlines...

      --
      "Shut up brain or ill stab you with a Q-tip" Homer Simpson
    3. Re:10? by Anonymous Coward · · Score: 0

      Extend and destroy. If you buy this pile of garbage you are a Microsoft Fool. Standard you say well who set the standard Microsoft Intel and CompUSA. Newsflash lets bait linux developers to our crap and screw them later when we lock them in to our formats and crap license. Flash Linux Developers rejected crap compiler bait and Microsofts response was damn! IDE screw your IDE I have emacs :)

    4. Re:10? by sean23007 · · Score: 1, Offtopic

      You've been around awhile, haven't you? People who aren't idiots can easily upgrade from their original +1 bonus to the more prestigious +2. You have obviously been unable to do this.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    5. Re:10? by damiam · · Score: 1, Offtopic

      Perhaps he's enough of a non-idiot to realize that not everything he says is worthy of being shouted, and occasionally checks the "No Bonus" box.

      --
      It's hard to be religious when certain people are never incinerated by bolts of lightning.
    6. Re:10? by sean23007 · · Score: 1, Offtopic

      Then again, if he has the +2 bonus, he should know that other people might just have it as well. That is, unless he really is an idiot. And I do occasionally check the "No Bonus" box. I don't know what you mean by shouted, because neither he nor I did it... unless of course you want to accuse yourself of the same thing.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    7. Re:10? by sean23007 · · Score: 1, Offtopic

      My karma is going to get killed for this, but that's okay, because as of this morning I had 50. How the hell was the parent rated Offtopic? It contained a quote from the article, and cited information given in the submission. The fact that the information was incorrectly cited (since I made an obvious and stupid mistake) should not by any means make it off-topic; rather, it should perhaps make it overrated, or, preferably, just ignored.

      --

      Lack of eloquence does not denote lack of intelligence, though they often coincide.
    8. Re:10? by Iamthefallen · · Score: 2, Offtopic

      Welcome to slashdot, where moderators with -1 offtopic rubber stamps run wild, 'tis a dangerous land for sure where triggerhappy moderators prey on those that dare stray from the path even by an inch.

      So I'll use my +1 bonus on this just for the hell of it and watch as they get their panties in a bunch from the exitement of knowing that they may deal their fearsome moderation not once, not twice, but three whole times before this post draws it last breath and disappears into the unseen -1 land, let my demise serve as an example, fear the -1 offtopic modders!

      --
      Wax-Museum Fire Results In Hundreds Of New Danny DeVito Statues
    9. Re:10? by buzter · · Score: 1

      The post said half a decade. Last I checked that is not 10 years, but rather 5. And, since 1998, four years have past making it very close to half a decade.

    10. Re:10? by jcast · · Score: 1

      Posted this first thing, huh?

      He already said to ignore it.

      --
      There are reasons why democracy does not work nearly as well as capitalism.
      -- David D. Friedman
  3. C+_ by Second_Derivative · · Score: 3, Funny

    We have here to my knowledge the first known /. misspelling of a story TITLE

    Yeah, well done, 'editors' ;)

    - S_D
    Has Karma to blow

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

      Please!

      They're not Editors!

      They're Users!

    2. Re:C+_ by blindbat · · Score: 1

      I actually thought it was a new language until I read the message.

      C+_ looks kind of like C+- so maybe it wasn't sure if it was better or worse than C.

    3. Re:C+_ by RealityThreek · · Score: 1

      It's kinda sad that the highest thread is someone picking on the poster. Are there any intelligent comments coming? :)

      --
      :wq
    4. Re:C+_ by Second_Derivative · · Score: 1

      Highest? eh, not for long. This'll get smashed down to Troll soon enough I'm sure. Still, I couldn't resist. And for all the demand for subscriptions on /. you'd think the editors would at least check the title.

    5. Re:C+_ by JollyTX · · Score: 1

      What's wrong with the story title?

      --
      Can you hear me, Major Tom? I'm not the man they think I am at home...
    6. Re:C+_ by Anonymous Coward · · Score: 0

      I think they were referring to the editor's GPA and not the programming language :-). Seriously, EDG is good stuff, they have Daveed Vandefoorde there, who is a fairly active C++ type, I think he used to work for HP.

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

      Nothing, it's been fixed now.

      (Lameness filter is lame, gzip compression is a crap way to detect information content, <xinclude:include href="shit-filter-on-ass-analogy.inc" /> and so on)

    8. Re:C+_ by Anonymous Coward · · Score: 0

      "Vapor" is spellt "Vapour".

    9. Re:C+_ by BtAFMB · · Score: 1

      So it should be "Vapour." not "Vapor"? Ha, go back to America, American-style quoting boy.

      --

      "I have fallen off the wagon, for I am a slave to tea."
  4. linux kernel by Anonymous Coward · · Score: 3, Funny

    "There are rumors they can compile the Linux kernel too"

    Finally!! Someone pulled it off!

    1. Re:linux kernel by Anonymous Coward · · Score: 0

      dismiss the rumors. everyone knows that they are just that.

  5. If its true... sweet :) by InSaNiAcK · · Score: 0, Offtopic

    Sweet :)

  6. GCC is missing stuff? by stonecypher · · Score: 4, Interesting

    If so, where can I go to find out what GCC is missing?

    (I had to write this three times because of that damn 20 second after reply widget. Thanks, trolls.)

    --
    StoneCypher is Full of BS
    1. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0
      As of version 3.x GCC is missing the capability to compile Linux kernel.

      Fuck that piece of shit.

    2. Re:GCC is missing stuff? by MrHat · · Score: 1, Offtopic

      No it's not.

      I'm running 2.4.18 compiled with GCC 3.0.4. How'd I do that?

    3. Re:GCC is missing stuff? by norwoodites · · Score: 5, Informative

      gcc is missing export and some other stuff see http://gcc.gnu.org/bugs.html for more examples of what is missing, scroll down.

    4. Re:GCC is missing stuff? by RealityThreek · · Score: 5, Informative

      Go buy the newest version of Bjarne Strostrup's book, and try out his example programs in the majority of C++ compilers.

      You'd be amazed at how much has been missing. Mainly the STL stuff, but there's some bugs in templating in some compilers too.

      It sucks when you try to write portable code in C++ and you end up not being able to use some cool stuff because not all compilers support it. A friend of mine switched to Java specificly because of this.

      --
      :wq
    5. Re:GCC is missing stuff? by Anonymous Coward · · Score: 1

      *cough cough* So my box must not have *Actually* booted up after last recompile... just my imagination, right? ;)

    6. Re:GCC is missing stuff? by Sancho · · Score: 3, Insightful

      Is the Linux Kernel written in C++? I thought it was straight C.
      Besides, even if it WAS in C++, most likely it would just use features that the compiler could handle.

    7. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0

      (I had to write this three times because of that damn 20 second after reply widget. Thanks, trolls.)

      No fucking problemo Karma Whore. As to what GCC is missing, it's called 'standards compliance'.

    8. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0

      The linux kernel is coded in INTERCAL. They use gcc-intercal to compile it.

    9. Re:GCC is missing stuff? by _|()|\| · · Score: 2
      where can I go to find out what GCC is missing?

      "Testing C++ Compilers for ISO Language Conformance" (Dr. Dobb's Journal, May 2002). This article introduces a Python framework that uses example code from the standard. Article and partial code available. Compilers include: GCC 3.0, 2.96, 2.95; Borland 5.5; VC++ 6.0.

      "C++ Conformance Roundup" (C/C++ User's Journal, April 2001). This article, referenced by the previous article, analyzed results from Dinkumware, Perennial, and Plum Hall. Compilers include: IBM, Sun, Metrowerks, Intel and KAI, MS, GNU, Borland, and Comeau.

    10. Re:GCC is missing stuff? by Matthew+Austern · · Score: 2, Informative

      Exported templates, universal character names in identifiers, and a few less important things. As of 3.1, gcc has a pretty complete standard library.

    11. Re:GCC is missing stuff? by _|()|\| · · Score: 1
      "Testing C++ Compilers for ISO Language Conformance" (Dr. Dobb's Journal, May 2002)

      Sorry, that's June 2002, currently on the stands.

    12. Re:GCC is missing stuff? by legis · · Score: 2

      > As of version 3.x GCC is missing the capability to compile Linux kernel.

      Just because it is not recommended yet does not mean that it does not work. I have been compiling the kernel with gcc 3.x when 3.0.3 came out with good results.

      Charles

    13. Re:GCC is missing stuff? by Mike+McTernan · · Score: 1

      You still can't beat ANSI C for portability though...

      --
      -- Mike
    14. Re:GCC is missing stuff? by stripes · · Score: 3, Informative
      You'd be amazed at how much has been missing. Mainly the STL stuff, but there's some bugs in templating in some compilers too.

      I don't think gcc is missing any of the STL stuff anymore (or rather the includes and libg++). GCC does have trouble with some of the "new" namespace stuff, and some edge cases in the type system can do the wrong thing (however they are far enough on the edge that maybe I was wrong about them, not gcc).

      It sucks when you try to write portable code in C++ and you end up not being able to use some cool stuff because not all compilers support it. A friend of mine switched to Java specificly because of this.

      Well that is the nice thing about pushing all the complexity into the libraries (yes Java is a more complex language the C...but less then C++ or Perl). Hmmm, speaking of Perl (or even Intercal...) it is also an advantage of really only having one implementation too...

    15. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0

      g++ is missing various things: the export keyword, the two-phase name lookup principle (which changes the meaning of a program; so that could be bad), universal character names and a number of other things.

      However, being fully compliant doesn't only mean you can put a checkmark next to every feature. The feature must be implemented correctly and invalid programs should get errors. That last part g++ does pretty poorly on. It swallows tons of things the online Comeau compiler (an EDG derivative) correctly gives errors on.

    16. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0

      Of course it's not "straight C" - if it was it could be compiled by any good old C compiler. You need to use GCC, remember?

    17. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0

      You're an idiot. The Linux kernel is written in C with GNU extensions. Not C++.

    18. Re:GCC is missing stuff? by cduffy · · Score: 1

      Hmm, speaking of Perl (or even Intercal...) it is also an advantage of really only having one implementation too...

      Having a sufficiently simple language definition makes having multiple compatible implementations a nonproblem. Consider Python -- it has three implementations (cpython, jython and stackless), and very rarely does one of the alternate implementations support something incorrectly. Scheme (well, R4RS and prior) tends to be consistantly well-implemented as well (granted, most scheme compilers and interpreters have varying extensions and such -- but it's rarer to see outright broken language features in them than in C++).

    19. Re:GCC is missing stuff? by stripes · · Score: 2
      Having a sufficiently simple language definition makes having multiple compatible implementations a nonproblem. Consider Python -- it has three implementations (cpython, jython and stackless), and very rarely does one of the alternate implementations support something incorrectly. Scheme (well, R4RS and prior) tends to be consistantly well-implemented as well (granted, most scheme compilers and interpreters have varying extensions and such -- but it's rarer to see outright broken language features in them than in C++).

      I beleve you....but...I think simplicity is only one part of the equation. There are two other big factors.

      C++'s standard frequently races ahead of any and all implmentations (i.e. there is no rule that youhave to actually try something before you add it to the standard!). The other languages you brought up...and many many other languages (APL for example) tend to grow by exparamenting, and deciding how much benifit people get from the work once they know how hard the work actually is! Granted if the group that did it is working on a comercial implmnetation then there is a strong motivation to try to convince others that this is a fine addition, and easy to do too. It is still better then never having any compiler with partial specilation (or whatever) and deciding that is now a standard feature.

      The other reason is the size of the prize. As far a sI know there is little if any money to be had from implmenting python or scheme, and there is clearly no money to be had from doing it poorly. For the most pary you get pride from doing a good job, and you might manage to make a little bank from it too, but not much. C++ is different, compilers are in haigh demand, mostly good ones, but with enough demand you can produce poor ones pass them off on unsusspecting fools and make real money (Visual C++ anyone?).

      I will also mention I used a C (not C++) compiler in the late '80s that didn't support the whole language -- this was pre K&R so it was even a pretty simple language. What did they leave out? The struct keyword, and with it, all structures. It basically sucked. So you can make a crappy implmentation of any language.

      I do freely admit though that if C++ were simpler, it would be implmented more fully more offten. There are a lot of features it has that I never use and could gladly see go (multiple inhartance, with or without virtual base classes for example). On the other hand there are features that I thought were of minimal value that I have seen used soooooo well that I have totally changed my mind (overloading for example, which I finally came to apreciate with the STL).

    20. Re:GCC is missing stuff? by Anonymous Coward · · Score: 0

      That's not quite fair. Visual C++ has been decent for a few years (though Plaugher's standard library was half-baked in the 6.0 days and should be upgraded), though I remember the years(!) while Borland had templates and Microsoft still didn't.

    21. Re:GCC is missing stuff? by MrHat · · Score: 1

      Okay, troll, let's look at the parent post:

      As of version 3.x GCC is missing the capability to compile Linux kernel.

      Where do you see anything about C++ in there? If you want to get pedantic, (and it appears you do), it's a 'compiler collection'. That includes C, which is what most people are referring to when they say 'gcc'. For your future reference, I'll say 'g++' so morons like you don't get confused.

      You're an idiot. The Linux kernel is written in C with GNU extensions. Not C++.

      Whose the idiot now? Perhaps the AC who didn't read the posts and decided to mouth off anyway? Who do you think you're impressing?

    22. Re:GCC is missing stuff? by MrHat · · Score: 1

      The parent post read:

      As of version 3.x GCC is missing the capability to compile Linux kernel. Fuck that piece of shit.

      I was replying to that post. Which obviously sank to the bottom rather quickly.

    23. Re:GCC is missing stuff? by jcast · · Score: 1

      It sucks when you try to write portable code in C++ and you end up not being able to use some cool stuff because not all compilers support it. A friend of mine switched to Java specificly because of this.

      Yeah, that way you can't use any of the cool stuff...
      --
      There are reasons why democracy does not work nearly as well as capitalism.
      -- David D. Friedman
  7. You mean usenet by Anonymous Coward · · Score: 2, Insightful

    It's a usenet thread, not a google thread.

    1. Re:You mean usenet by Anonymous Coward · · Score: 4, Funny

      There was a time when it was called usenet. Unless you have been living in a cave you will know that Google bought the usenet and renamed it to google groups.

    2. Re:You mean usenet by Anonymous Coward · · Score: 0

      You're probably one of those people whose computer doesn't have a start button. You're probably one of those people who says "web brower" instead of "netscape." You're probably one of those people who says "pointing device" when he means "mouse" and "artificial vaginal simulator" when he means "hand."

    3. Re:You mean usenet by Anonymous Coward · · Score: 0

      or "wanker" when he means "you".

    4. Re:You mean usenet by Jester99 · · Score: 2
      Blockquoth the poster:

      There was a time when it was called usenet. Unless you have been living in a cave you will know that Google bought the usenet and renamed it to google groups.


      Uhm. Here, I must disagree with you. They didn't "Buy the USENET" in the same way that it is impossible to "Buy the web" or "Buy Email."

      They did, however, successfully purchase an archive of the last twenty years of USENET posts, and currently archive all USENET posts made today. Their copy/mirror of USENET is called "Google Groups."
    5. Re:You mean usenet by Anonymous Coward · · Score: 0

      I bet you are the life of the parties huh?

    6. Re:You mean usenet by mrfiddlehead · · Score: 1

      Just the fact that your comment inspired so little commentary is enough evidence that /. is now populated almost exclusively by wannabe 15 year old snot nosed wankers. There was a time when usenet was cool, and if you could stand up to Geoff Miller you had real cajones. Those days are gone.

      --
      :wq
  8. what am I missing? by TheQuantumShift · · Score: 2, Interesting

    So up until now all compilers have been incomplete? What insanely great features have had to be left out because of this? I'm not a developer, so I'm more than a little ignorant. Mainly I'm just wondering if this will allow fewer lines in the same code, shorter compile times, etc...

    --

    Shift happens. Fire it up.
    1. Re:what am I missing? by Screaming+Lunatic · · Score: 1

      I think it will be the first compiler that implements partial template specialization. I'm pretty sure VC, Intel, and GCC do not implement that at the moment.

    2. Re:what am I missing? by Anonymous Coward · · Score: 0

      Very little has been left out, and it is of very little consiquence. As an example, most C compilers left out some of the more obscure keywords, such as "entry", which was never implemented in all but the first K&R compilers. No one missed it :)

    3. Re:what am I missing? by TheQuantumShift · · Score: 1

      And my other question, why hasn't it been done before? Why have all the others left out this support?

      --

      Shift happens. Fire it up.
    4. Re:what am I missing? by jjoyce · · Score: 1

      C++ is such a huge, complex language that it is a monumental effort to write an ISO/ANSI compliant compiler for it. With gcc, it's not that full compliance was left out, it's just that no one has gotten around to adding all of it yet. I'm unsure about the reasons why commercial compilers are not compliant, but I'd bet it has something to do with the sheer enormousness of the task and they'd rather sell compilers than wait for years.

    5. Re:what am I missing? by Anonymous Coward · · Score: 2, Informative

      No, partial specialization has been supported by most compilers EXCEPT for VC++ for quite a while now. That's the biggest gripe that I (and many others) have with the MS compiler. Fix that, and some of the other problems would go away as well (it would be much easier to write a decent implentation of the standard library, for one).

    6. Re:what am I missing? by Anonymous Coward · · Score: 0

      Some featurs have proven to be a real bitch to implement. Name space proved to be hairy, try/catch/throw has been problematic, and templets can give implementors nightmares. What is in the spec an add-on feature, in reality can involve massive changes to the entire compiler. In my opinion, the C++ spec is basicaly a hack, and will always have the problems that hacks have. I am currently rounding up support to switch the code base I help develop to Ada93.

    7. Re:what am I missing? by Josh · · Score: 2, Informative

      The implementation of the 'export' feature for templates has been missing from most compilers. Having it enables projects to possibly compile faster and with less code bloat in the binaries. Using templates often leads to faster executables than other strategies for doing the same thing.

    8. Re:what am I missing? by norwoodites · · Score: 1

      It will not be less code bloat, the code size would be the same but the code will compile faster because the compiler would have to go through as much code.

    9. Re:what am I missing? by Josh · · Score: 2, Interesting

      It is less code bloat in the individual object (.o) files. Shouldn't affect a final executable, but it does affect space/compile time on a developer's machine.

    10. Re:what am I missing? by Anonymous Coward · · Score: 0
      if I couldn't entry my penis into a woman's vagina, I'd miss it.

      Of course, most slashdot readers wouldn't miss it, never having what it's like in the first place

    11. Re:what am I missing? by Daveed_V · · Score: 1

      Because it's insanely hard to implement ;-)
      (I work for EDG)

    12. Re:what am I missing? by Anonymous Coward · · Score: 0
      It is less code bloat in the individual object (.o) files. Shouldn't affect a final executable, but it does affect space/compile time on a developer's machine.

      Not necessarily. It depends on the instantiation model. With compilers that handle automatic instantiation through recursive recompilation (prelinking), each required template instance will be compiled exactly once anyway (whether export is used or not). Most compilers fall into this category. I think your comment only applies to the few compilers that use the Borland/GCC instantiation model, where all templates needed for each unit are instantiated during the compilation of the unit and placed into its object file. Duplicate instances are then thrown out at link time.

    13. Re:what am I missing? by (outer-limits) · · Score: 1
      C++ has disappeared into the void of the something so powerful, very few people understand it. Sort of a modern day Tower of Babel.

      Time to move on to a new programming paradigm. As someone has pointed out, Java has shifted the complexity onto the library. It will also soon support generic classes, which should be an easier thing to use than templates.

      What neither language really knows how to handle is multiple inheritance, something that C++ has, but is difficult to use, or Java, which just ignores the concept.

      As for me, I have given up and am learning Ocaml, which seems to be travelling on the True Path to Enlightenment.

      --

      Microsoft - Where would you like to go today, Maybe Jail?

  9. GCC code is slow as molasses by October_30th · · Score: 2, Informative
    GCC code is slow.

    I code computationally intensive number crunching code and I had to buy Intel's compiler for Intel and Compaq's compiler for Alpha just to get some performance. And I'm talking about 10-20% difference.

    --
    The owls are not what they seem
    1. Re:GCC code is slow as molasses by Anonymous Coward · · Score: 0

      Unfortunately that is the result you get when you focus on getting gcc to be cross-platform instead of high-performance on a specific platform.

      However, the optimizer in the latest version of gcc is much better and continues to get worked on. I just don't ever expect to see gcc optimized code ever beat out the intel compiler optimized code on the x86 platform.

    2. Re:GCC code is slow as molasses by October_30th · · Score: 1
      when you focus on getting gcc to be cross-platform

      I still don't see why there aren't advanced CPU specific forks of the gcc. Is it just lack of developer interest or something related to the attitude of the main tree developers?

      I do agree that portability is highly recommendable and that it is one of the strong points of GCC.

      --
      The owls are not what they seem
    3. Re:GCC code is slow as molasses by Anonymous Coward · · Score: 0

      Both i386 and Alpha do have weird FPU instruction set dificult to support by GCC. GCC 3.1.0 with SSE on P4 scores much better

    4. Re:GCC code is slow as molasses by randombit · · Score: 1

      I code computationally intensive number crunching code

      I don't know if you care about this, or whatever. But...

      I would assume you mean floating point, since that's what most number crunching is in (and also because GCC totally crushes Intel C++ in the area of computationally intensive integer code - that's my big thing). GCC 3.1 is supporting SSE, which (supposedly) increases the fp speed on SSE machines by 10-20%. Of course, if you already have the compilers, I doubt you care (Compaq's compiler is really nice, I rather like it).

      And what are you thinking, running heavy fp code on x86 when you have an Alpha? :P

    5. Re:GCC code is slow as molasses by October_30th · · Score: 1
      And what are you thinking, running heavy fp code on x86 when you have an Alpha?

      Prototyping and clustering, mainly.

      --
      The owls are not what they seem
    6. Re:GCC code is slow as molasses by Unknown+Lamer · · Score: 4, Informative

      GCC code is slow.

      I code computationally intensive number crunching code and I had to buy Intel's compiler for Intel and Compaq's compiler for Alpha just to get some performance. And I'm talking about 10-20% difference.

      Then you should like GCC 3.1. Here is a snippet from the changelog (you can see the entire list of changes at http://gcc.gnu.org/gcc-3.1/changes.html):

      • According to the SPECInt2000 results on an AMD Athlon CPU, the code generated by GCC 3.1 is 6% faster on the average (8.2% faster with profile feedback) compared to GCC 3.0. The code produced by GCC 3.0 is about 2.1% faster compared to 2.95.3. Tests were done using the -O2 -march=athlon command-line options.
      • The compiler now supports MMX, 3DNow!, SSE, and SSE2 instructions. Options -mmmx, -m3dnow, -msse, and -msse2 will enable the respective instruction sets. Intel C++ compatible MMX/3DNow!/SSE intrics are implemented. SSE2 intrics will be added in next major release.
      • Following those improvements, targets for Pentium MMX, K6-2, K6-3, Pentium III, Pentium 4, and Athlon 4 Mobile/XP/MP were added. Refer to the documentation on -march= and -mcpu= options for details.
      • For those targets that support it, -mfpmath=sse will cause the compiler to generate SSE/SSE2 instructions for floating point math instead of x87 instructions. Usually, this will lead to quicker code -- especially on the Pentium 4. Note that only scalar floating point instructions are used and GCC does not exploit SIMD features yet.
      • Prefetch support has been added to the Pentium III, Pentium 4, K6-2, K6-3, and Athlon series.
      • Code generated for floating point to integer converisons has been improved leading to better performance of many 3D applications.
      There is also AltiVec support for the PowerPC now. You can also trying using -fprofile-arcs, run your program once, then recompile with -fbranch-probabilities to help GCC predict branches (but then again if all your code does is crunch large numbers, there might not be too many branches in the first place).
      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
    7. Re:GCC code is slow as molasses by Bert64 · · Score: 1

      Compaq compiler for Linux is infact free to download, unfortunately your still stuck running a kernel and set of libs compiled with gcc

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    8. Re:GCC code is slow as molasses by Bert64 · · Score: 1

      // And what are you thinking, running heavy fp code on x86 when you have an Alpha? :P Unfortunately, the benefits of having an alpha are largely negated when half of your software MUST be compiled using a slowass compiler like gcc

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    9. Re:GCC code is slow as molasses by jrwyant · · Score: 1

      Additionally, there are patents on performing certain algorithms, etc., which preclude GCC from optimizing in certain manners. Search Slashdot for similar GCC topics, this patent aspect is discussed many times.

    10. Re:GCC code is slow as molasses by Billly+Gates · · Score: 2

      I believe the alpha version of gcc has had some optimization problems for some time. I remember reading here back in 99 about a %40-50 performance hit for standard c code. This created headaches for alphalinux. If you compilied the code with gcc the kernel would be as slow as mollasis. The problem is that most hackers who write gcc have intel based machines. The rest use a few sparcs and powerpc's from apple since they can compile the code more optimally for their platforms. This is why many risc linux users still avoid using alpha's. I know there was a similiar problem for powerpc linux a couple of years ago until enough programers bought some macs and fixed it.

    11. Re:GCC code is slow as molasses by cutterjohn · · Score: 1

      er... Apple has a beta version of gcc 3.1 with full objective C support AND altivec supprot.

      --
      --- C00l .signatures please apply within...
    12. Re:GCC code is slow as molasses by Anonymous Coward · · Score: 0
      And what are you thinking, running heavy fp code on x86 when you have an Alpha? :P

      That would have been a good comment about a year ago. But currently, the fastest shipping Alpha doesn't keep up with the FP performance of the latest Intel and AMD offerings, even without considering SSE2. So unless you're talking about _really_ big problems where Alpha/Tru64 clustering is needed, I don't see why you would recommend Alpha anymore.

    13. Re:GCC code is slow as molasses by sjnokker · · Score: 1

      Hmm. You seem to know your way around in C++/compiler land. Maybe you or anyone else can help me with the following:

      For my template classes to compile I need to add -fguiding-decls as an option to g++. Since 3.0 this option has disappeared. I'll gladly fix my code, but don't know what I'm doing wrong. Can't find anything meaningful in the docs, google etc.

    14. Re:GCC code is slow as molasses by randombit · · Score: 1

      Unfortunately, the benefits of having an alpha are largely negated when half of your software MUST be compiled using a slowass compiler like gcc

      That's why you use Compaq's Alpha compiler if you need fast code on the Alpha.

    15. Re:GCC code is slow as molasses by Unknown+Lamer · · Score: 2

      er... Apple has a beta version of gcc 3.1 with full objective C support AND altivec supprot.

      GCC 3.0.4 also has full Objective-C support. You probably mean Objective-C++. Objective-C++ isn't really its name, but it gets the point across I guess (you can mix C++ and Objective-C code in the same file to gain the strengths of both...e.g. Objective-C's better class system + C++'s overloading support). I think that Apple recently (a few months ago) donated the C++ support to the Objective-C compiler to GNUStep.

      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
    16. Re:GCC code is slow as molasses by Matthew+Austern · · Score: 2, Informative

      Guiding declarations are an obsolete and rather arcane feature that was present in some early versions of pre-standard C++ but that aren't part of the C++ standard. For the most part they're only of historical interest. (Assuming you're interested in the history of such things, that is.)

      If you've got legacy code that used guiding declarations and you need to know how to convert it to standard C++, there's a nice discussion in the kcc documentation.

    17. Re:GCC code is slow as molasses by sjnokker · · Score: 1

      If you've got legacy code that used guiding declarations and you need to know how to convert it to standard C++, there's a nice discussion in the kcc documentation [www.hlrs.de].

      Thanks, this was a big help. After understanding this rewriting my code was a breeze. I understand this is even more off-topic than my original post, but couldn't resist thanking you.

    18. Re:GCC code is slow as molasses by Bert64 · · Score: 1

      But Linux and FreeBSD kernels must still be compiled using gcc, glibc also demands gcc.. and whatever you compile will still likely be depending on these..
      Ofcourse you could use Tru64, but many programs are incompatible.. and you would have even more work making your programs compile than under linux/ccc

      --
      http://spamdecoy.net - free throwaway anonymous email - avoid spam!
    19. Re:GCC code is slow as molasses by jcast · · Score: 1

      Then stop using gcc -O0 ;)

      --
      There are reasons why democracy does not work nearly as well as capitalism.
      -- David D. Friedman
    20. Re:GCC code is slow as molasses by Anonymous Coward · · Score: 0

      This was totally off topic but it was exactly the ultra cool nerd kind of thing I used to read slashdot comments for. Someone mod it up even if it WAS off topic, please, we need more people like this guy (the guy who answered the question) and more comments this informative..

    21. Re:GCC code is slow as molasses by Anonymous Coward · · Score: 0
      10-20% faster? Wow.

      Why not just spend another $25 for a faster CPU? Or wait three weeks?

  10. So, what DOES linux compile with? by hackwrench · · Score: 1

    What compiler is used to compile Linux?

    1. Re:So, what DOES linux compile with? by keesh · · Score: 1, Flamebait

      gcc 2.x. Just not 2.96, because it doesn't exist.

  11. A REPLACEMENT FOR C++ by egg+troll · · Score: 2, Funny

    Hello Gentlemen,

    I'm a first year programming student at an Ivy League school and I've just finished my Visual Basic classes. This term I'll be moving onto C++. However I've noticed some issues with C++ that I'd like to discuss with the rest of the programming community. Please do not think of me as being technically ignorant. In addition to VB, I am very skilled at HTML programming, one of the most challenging languages out there!

    C++ is based on a concept known as Object Oriented Programming. In this style of programming (also known as OOPS in the coding community) a programmer builds "objects" or "glasses" out of his code, and then manipulates these "glasses". Since I'm assuming that you, dear reader, are as skilled at programming as I am, I'll skip further explanation of these "glasses".

    Please allow me to make a brief aside here and discuss the origins C++ for a moment. My research shows that this language is one of the oldest languages in existance, pre-dating even assembly! It was created in the early 70s when AT&T began looking for a new language to write BSD, its Unix Operation System (later on, other companies would "borrow" the BSD source code to build both Solaris and Linux!) Interestingly, the name C++ is a pun by the creator of the language. When the first beta was released, it was remarked that the language would be graded as a C+, because of how hideously complex and unwieldy it was. The extra plus was tacked on during a later release when some of these issues were fixed. The language would still be graded a C, but it was the highest C possible! Truly a clever name for this language.

    Back to the topic on hand, I feel that C++ - despite its flaws - has been a very valuable tool to the world of computers. Unfortunately its starting to show its age, and I feel that it should be retired as COBOL, ADA and Smalltalk seem to have been. Recently I've become aquainted with another language that's quite recently been developed. Its one that promises to greatly simplify programming. This new language is called C.

    Although syntactically borrowing a great deal from its predecessor C++, C greatly simplifies things (thus its name, which hints at its simpler nature by striping off the klunky double-pluses.) Its biggest strength is that it abandons an OOPS-style of programming. No more awkward "objects" or "glasses". Instead C uses what are called structs. Vaguely similiar to a C++ "glass", a struct does away with anachonisms like inheiritance, namespaces and the whole private/public/protected/friend access issues of its variables and routines. By freeing the programmer from the requirement to juggle all these issues, the coder can focus on implementing his algorithm and rapidly developing his application.

    While C lacks the speed and robustness of C++, I think these are petty issues. Given the speed of modern computers, the relative sluggishness of C shouldn't be an issue. Robustness and stability will occur as C becomes more pervasive amongst the programming community and it becomes more fine-tuned. Eventually C should have stablity rivalling that of C++.

    I'm hoping to see C adopted as the de facto standard of programming. Based on what I've learned of this language, the future seems very bright indeed for C! Eventually, many years from now, perhaps we'll even see an operating system coded in this langauage.

    Thank you for your time. Your feedback is greatly appreciated.

    Egg Troll

    --

    C - A language that combines the speed of assembly with the ease of use of assembly.
    1. Re:A REPLACEMENT FOR C++ by Anonymous Coward · · Score: 0

      You were supposed to post this on Usenet.

    2. Re:A replacement for C++ by fatphil · · Score: 1

      It's called 'C++' because it has the value of C, but causes C to change.

      FP.

      --
      Also FatPhil on SoylentNews, id 863
    3. Re:A replacement for C++ by Anonymous Coward · · Score: 2, Interesting

      Dude! You totally ripped that off from an earlier comment attached to this story!

      Wow, good use of plagarism!

    4. Re:A replacement for C++ by smallstepforman · · Score: 1, Flamebait

      Troll alert!!!

      Thank you, you have been trolled (all posts arguing with him).

      --
      Revolution = Evolution
    5. Re:A replacement for C++ by Anonymous Coward · · Score: 0
      It was created in the early 70s when AT&T began looking for a new language to write BSD
      Stop with the revisionist history! Everyone knows C++ was invented by Microsoft! What an imbecile.
    6. Re:A replacement for C++ by Anonymous Coward · · Score: 0

      Cool article :)
      This article is a nice piece of sophistic technique, but I agree with its hidden conclusions :) Very very nice!!!

      >In addition to VB, I am very skilled at HTML >programming, one of the most challenging >languages out there!
      lol :)

      >Its biggest strength is that it abandons an OOPS->style of programming. No more awkward "objects" >or "classes". Instead C uses what are called >structs. Vaguely similiar to a C++ "class", a >struct does away with anachonisms like >inheiritance, namespaces and the whole >private/public/protected/friend access issues of >its variables and routines. By freeing the >programmer from the requirement to juggle all >these issues, the coder can focus on >implementing his algorithm and rapidly >developing his application.

      :)

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

      Dude, but you can't run Win2k on those leet VAX's that linux runs on.

      Man, Those things are soo much faster than my computer.

      NE1 know where I can get one?

  12. Compile the kernel? by NicolaiBSD · · Score: 1

    > There are rumors they can compile the Linux kernel too.

    Sjeesh this is news? I have been able to compile the kernel for years now. OK, I have to admit I do sometimes forget to put vital things in like netlink code, but then I just compile again and usually it works.
    I'm sure there are hundreds of Slashdot readers who are able to compile the kernel so I don't understand what the fuzz is.

    1. Re:Compile the kernel? by BlueFall · · Score: 2, Informative

      The kernel has been pretty much tailored to gcc and many other compilers seem to have trouble with it.

  13. Ahhh by PhoenxHwk · · Score: 2, Funny

    Wow! A compiler! Now all we need is a language whose syntax makes sense! I have an easier time coding in Perl than trying to use the bloody C++ STL.

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

      Wow! I have an easier time configuring Windows than bloody Linux!

      Shut up karma whoring troll.

    2. Re:Ahhh by ZxCv · · Score: 3, Interesting

      .... Now all we need is a language whose syntax makes sense! ....

      Which is the exact reason I've moved pretty much completely to Objective-C. After cursing C++ for years, I've finally found peace with a C-like, object-oriented language that makes sense. I learned Obj-C when I was getting familiar with OS X development, and I haven't used C++ on anything since, on any platform. Obviously, I still have to maintain plenty of C++ code, but as time goes on, that amount will become less and less and eventually, I'll be rid of C++ forever!

      --

      Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;
    3. Re:Ahhh by Anonymous Coward · · Score: 0

      I have an easier time coding in Perl than trying to use the bloody C++ STL.

      Then don't.

      You don't have to use every languages feature, in fact you don't have to use C++ at all. If you don't have the skill to use it, don't.

    4. Re:Ahhh by Cardhore · · Score: 2

      Like scheme?

    5. Re:Ahhh by Peaker · · Score: 2

      Objective C is even worse.
      It is a compelete hack around C, its the slowness of Smalltalk, with a syntax as ugly as C++ and even worse.
      Move to Python, Smalltalk or Lisp instead.

    6. Re:Ahhh by fatphil · · Score: 1

      As someone who lectured C++ back in 1993 and 1994, I can only say one thing...

      ... you're completely right.

      I've not used Obj-C, but I sure know that the C++ of today is _half_ the language it used to be, when it only had half of the features.

      FP.

      --
      Also FatPhil on SoylentNews, id 863
    7. Re:Ahhh by Anonymous Coward · · Score: 0

      No, not like scheme.

      (Sorry, couldn't resist ;)

    8. Re:Ahhh by PhoenxHwk · · Score: 2

      Hey. I'm just making the point that the already-implemented features make C++ a burden to use. C++ is always the last language I would ever choose to do anything in. Last thing, IMHO, that it needs is more crap I'll never be able to use.

    9. Re:Ahhh by wbajzek · · Score: 1
      Any "object oriented extension" to C is going to be somewhat of a hack. I disagree about the syntax being uglier than C++; the simplicity of Obj-C made it a hell of a lot easier to learn than C++ for me. I did try; it just never made sense to me (the way Perl no longer makes sense to me, in spite of the 7 years I spent working with it). For me, Objective-C is like Java with named parameters and the speed of native code.

      I do like Python, though, and also wish that there was a decent smalltalk w/ native GUI for OS X. Hopefully someday. Squeak is fun and cute, but realistically those things pretty much completely kill any opportunity to use it professionally. It sucks that all these great technologies are being relegated to obscurity because of ...

      I was trying to figure out how to end that sentence, and all I could come up with was Microsoft and FUD. I've been reading too much Slashdot!

    10. Re:Ahhh by Anonymous Coward · · Score: 0

      If you have an easier time coding in Perl, then you haven't made the effort to learn C++. Make the effort to learn C++ and you will be well rewarded. Its like mathematics; it can be frustrating at first but the power that comes from understanding is enormous.

      C++ is an incredibly practical and effective language; probably THE most effective language. C++ is still a highly popular language, and for very good reason; its good! There is no huge corporate sponsor pushing C++. Its popularity is driven purely by the developer community (unlike Java).

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



      Ok, as long as C++ is your favorite I won't call you a karma whore.

    12. Re:Ahhh by pauljlucas · · Score: 1
      Now all we need is a language whose syntax makes sense!

      It makes sense to me . C++ adds new keywords to C, but doesn't add much in the way of new syntax. About the only exception are the use of angle brackets for templates and pointers to member functions, the latter of which isn't used all that often. Hence, if you don't understand C++'s syntax, they you never really understood C's either.

      I have an easier time coding in Perl than trying to use the bloody C++ STL.
      You're comparing a langauge (Perl) to a library (STL). Apples and oranges. You need to compare STL to something like CPAN which is a lot larger and more disorganized than STL because CPAN isn't standardized.

      STL is a true masterpiece (to those who understand it). Algorithms are completely separate from data structures. Algorithms can even work on built-in vectors.

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    13. Re:Ahhh by pyrrho · · Score: 2

      slow on the uptake I'm only now realizing that C++ is a topic of some fea^H^H^H^H controversy on slashdot.

      C++ syntax makes perfect sense. There are no arbitrary relationships. As a multi-paradigm language it allows you to choose a subset of features for a given product, depending on what you need.

      You do not need the STL to write C++ code. However, you are crazy not to use it, becuase they are generally excellently implemented collections useable in any program... and the STL is an elegant flexible system. Like most great feats of software engineering you have to think it's way to get it to work, and then it is your friend.

      I'm starting to get a big laugh forming for all the complaints of C++ just being too darn hard. Why do I not find it hard? Do I know restraint? Do I just get it? Bad taste? Infinite wisdom?

      I can but wonder, will I lose or gain karma for speaking well of noble C++!

      --

      -pyrrho

    14. Re:Ahhh by Kirruth · · Score: 2
      C++ syntax makes perfect sense. There are no arbitrary relationships. As a multi-paradigm language it allows you to choose a subset of features for a given product, depending on what you need.

      Bless you. As far as I am concerned, C++ is still the greatest open standard we have. There will always be "best of breed" languages which are stronger in their own field of affairs: its hard to beat Perl for text, or Haskell for maths. But as a resolutely general-purpose language, which is owned by nobody except its users, C++ remains the first and best of its kind.

      I still don't think we have explored even half its potential: it'll be interesting to see what contribution a truly standard-compliant compiler makes to this.

      --
      "Well, put a stake in my heart and drag me into sunlight."
    15. Re:Ahhh by cduffy · · Score: 2

      Have you ever written anything in a truly elegant language? Go learn one, and code in it for a while (about half a year will do), and see if you can go back to C++.

    16. Re:Ahhh by pyrrho · · Score: 1

      (1) I think the search for the elegant language is akin to the search for the fountain of youth... you may encounter some elegance along the way.

      (2) I think languages are best judged based on power and flexibility, not 20'th century value judgements on beauty, which is what "elegance" is. I know that's a little trit

      (3) I think "elegant" is a personal value judgement, such that the elegant languages you mention can, at best, at unlikely best, be elegant for you, not me, or vice versa.

      I prefer a language with a lot of possibilities, such that I can cull those possibilities and use what makes sense in a perfect case. Having special languages for special purposes is fine, but it's a false economy if you then have to learn 50 different languages, to avoid learning 1 language with 50 different sensible paradigms.

      Btw, by "elegant language" were you refering to C or Pascal? Applesoft BASIC maybe?

      --

      -pyrrho

    17. Re:Ahhh by cduffy · · Score: 2

      Personally, I consider Scheme and Python both elegant languages -- C and Java are clean, but not quite elegant; C++ is not even clean.

      That said... elegance in this context is not just about beauty (though elegant languages are beautiful) but about simplicity. Simplicity is a very important quality for a language to have -- looking only at power and flexibility without simplicity as a balancing factor leads to languages like Perl where things like regular expressions have their own built-in syntax. Further, simplicity is less of a personal value judgement than you make it to be. Yes, there's something to elegance beyond simplicity -- but simplicity is perhaps at the core of all that is elegant. There is a widely appealing aesthetic element, however, just as much as with Behtoven's music or Dali's paintings. One simplistic test: I can introduce Python to first- and second-year programming students, and in under two minutes they're wowed. That doesn't happen with C++, or even C or Java (and certainly not Pascal or BASIC). Elegance alone isn't useful in the Real World, of course -- but back it with power and one has a truly Good Thing.

      Learning 3 or 4 different languages and being able to pick the one that makes any job easiest (that is, the code simplest and thus most maintainable and extendable) is far, far better than having a hammer and being convinced that any problem you look at happens to be a nail.

  14. every c++ compiler is different by rebelcool · · Score: 3, Informative
    so far, c++ code hasnt been very portable among different compilers (even different versions of the same compiler... i've got plenty of textbook code around that compiles under the g++ 2.x series, but not g++ 3)

    They all don't properly implement different parts of the standard, which leads to all sorts of cross platform issues.

    It's about time someone has done something about it. EDG is no small name in the compiler world either..

    --

    -

    1. Re:every c++ compiler is different by BlueFall · · Score: 1

      I think there's a bit more to it than just compliance to the standard. My understanding of C++ is that it doesn't define things like how class data is stored, standard name-mangling, etc. (And this is a hard thing to do, too.) So I guess that this is a good step towards compiler compatibility, but linking will probably still be a problem.

    2. Re:every c++ compiler is different by randombit · · Score: 4, Informative

      My understanding of C++ is that it doesn't define things like how class data is stored, standard name-mangling, etc.

      Which, overall, is a good thing. I should note C doesn't either - the C ABIs are specified by systems people. For example, there is a System V ABI for x86, which is basically what all the Unix versions on x86 use.

      So I guess that this is a good step towards compiler compatibility, but linking will probably still be a problem.

      There is now an official IA-32 C++ ABI. Nobody has done it completely, but GCC and Intel are supposed to converge on it in the future. There has also been an IA-64 C++ ABI since the start, though AFAIK some incompatibilies still remain between different compilers (but they are working on it, I think).

    3. Re:every c++ compiler is different by randombit · · Score: 2, Interesting

      compiles under the g++ 2.x series, but not g++ 3)

      Then:

      a) It's not ISO C++ compliant code: you should sell them, or throw them out, or burn them, or something.

      or

      b) It's a regression in GCC. In which case you should report it to the GCC team. They are very concerned with regressions, and work hard to make them go away (the release of 3.1 is currently blocked on a small handful of regressions)

      Given that it's a textbook, and textbook code is usually pretty trivial, I'm leaning highly towards (a) as the correct answer.

      ISO C++ broke a lot of old (pre-Standard) C++ code. Them's the breaks. But I've written a ~18K line C++ program (using modern features like the STL, dynamic_cast, etc) that runs on egcs 1.1.2 up to gcc 3.0.4, and over half a dozen commercial compilers, including VC7. Portability is entirely possible, it just needs some care, just like it does with C or Perl.

    4. Re:every c++ compiler is different by stevey · · Score: 1

      Thankfully whilst that is true it doesn't bite too many people. I think that the folk that are using esoteric functions are capable of using a design patterns to work around differences.

      A case in point .. for my own amusement I started writing a network server in C. It worked, but was getting hard to extend.

      Because I didn't have easy access to anything else, and for the learning experience I chose to re-write this in C++.

      Using only minimal STL code I now have the code running on Cygwin, Linux, the BSD's, MacOS X and Solaris.

      True they all assume GCC - but it will work on other compilers too; so while I accept that portability can be a problem in using templates, etc, in C++ I'm not sure how much of a problem it really is .. in practice.

    5. Re:every c++ compiler is different by Matthew+Austern · · Score: 2, Informative
      There has also been an IA-64 C++ ABI since the start

      To be a bit more specific, it's an ABI for IA-64 Unix systems that use the ELF object format.

      That's an awful lot of qualifications, but they're necessary. (And not just for C++.) Even such simple things as function calling conventions differ from platform to platform, and linkers are a lot less trivial, and involve a lot more design choices, than most people realize.

    6. Re:every c++ compiler is different by be-fan · · Score: 2

      Actually, Intel C++ 6.0 and GCC 3.1 (out real soon now) should both support almost all of the ABI. Intel says you can link ICC-compiled stuff to GCC compiled stuff now. It seems to work for some basic code so far, but I haven't tried anything complex yet.

      --
      A deep unwavering belief is a sure sign you're missing something...
    7. Re:every c++ compiler is different by larry+bagina · · Score: 1
      For the last time....

      The gcc 2.x series had errors that were fixed in 3.0. The Linux kernel has some code that depends on the (incorrect) behavior of gcc 2.x. The kernel code has been cleaned up somewhat, but won't be 3.0-happy until Dictator Linus says so.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    8. Re:every c++ compiler is different by Isle · · Score: 1

      It links allright, but work is does not!

      I believe icc are closer the C++ ABI, or maybe gcc-3.1 are just more open about their non-complience.

      Also there is C++ ABI for sparc/solaris. Atleast Sun's CC compiler supports it. Since their compiler also works x86, they might even generate x86 C++ ABI stuff. (this created a incompatiblity between version 4 and version 5)

      Next experiment: try to link solaris-x86 and intel-icc code.

  15. C+_ by CptNoSkill · · Score: 2, Funny

    It is good to see the conspiracy of silence finally ended. I have been using this program language since it was started, and finally to see C+_ to get the respect it deserves.I'd say it is the greatest... wait a minute, C++ where the hell did that come from??? Damn, slashdot, covering up the real "C+_" with the fake C++ language,can you say
    C-O-N-spiracy

  16. Not much by Bastian · · Score: 4, Interesting

    Unless a few of the unimplemented language features have uses that nobody has thought of (not entirely unlikely since this is the first compiler I know of that supports all of them), I doubt it will make a huge difference for most coders. C++ programmers have gotten along fine without them thus far.

    However, it is nice to see that they have made it in. Maybe now other groups will start imlementing the full language, too.

    1. Re:Not much by randombit · · Score: 1

      Unless a few of the unimplemented language features have uses that nobody has thought of (not entirely unlikely since this is the first compiler I know of that supports all of them)

      The only one I can think of is export. Export is hard, maybe even impossible, to get right. If it could be made to work, it would be amazingly useful. But I'm skeptical export will ever really work, especially in the presense of things like shared libraries.

    2. Re:Not much by larry+bagina · · Score: 1
      export applies to the object files. In ELF (AFAIK), the default is to export all symobols, and I'm not even sure it's possible to not export a symbol.

      Some object file formats support it (PEF, PE), so in windows & mac land, you just __declspec(export) a function or variable to export it (or set a compiler flag to export everything, which may cause link errors).

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:Not much by IkeTo · · Score: 1

      What you are talking about is extern, not export. Extern is fully supported by any C++ compiler. Export is not supported by any so far---before this report. Look into The C++ Programming Language (Bjarne Stroustrup) to see what it is. In short, it should allow an uninstantiated template definition to appear in an object file, allowing other object files to somehow use an instantiated version of it without seeing the code again during compilation. Pretty tough requirement indeed.

    4. Re:Not much by Anonymous Coward · · Score: 0

      can you say template template parameters, correct template specializations, member template functions, and inner classes? things that are extremely useful, if you can find a compiler that supports them.

  17. rm InSaNiAcK by sydb · · Score: 1, Offtopic

    Why did you post?

    Besides having nothing to say, you chose a sickening way to say it, the word 'sweet'.

    I bet in your head you heard it as "shweet" too, but you didn't know how to spell it. That's even more sickening.

    --
    Yours Sincerely, Michael.
    1. Re:rm InSaNiAcK by sydb · · Score: 1, Offtopic

      I'm offtopic? Did the dickwad moderator read the inanity of the parent post????????

      --
      Yours Sincerely, Michael.
    2. Re:rm InSaNiAcK by Anonymous Coward · · Score: 0

      "Dude.. Where's my car?" :p

  18. More compilers from /. by rajinikanth · · Score: 0

    I am going to wait for the C_+ compiler from slashdot, instead!!

  19. C+_ by gmuslera · · Score: 1

    For a moment I thinked that it was something related to C#, like an expanded subset, named by an ascii art fan

  20. From Later in the Thread by Ieshan · · Score: 5, Informative

    "The product Edison sells is basically just the front end. Someone needs
    to add a code generator, libraries, support tools, etc. to produce
    a complete compiler package. (We use the Edison front end for our
    compiler product at Concurrent, so hopefully we'll have all these
    nifty features someday - but everyone should be sure they don't
    interpret this casual comment as an official promise - I don't even
    work on the compiler :-)."

    I dont know how right this guy is, and I have no expertise in the area myself... but isn't this exactly what we're doing with this slash story? Interpretting this comment as an official promise?

    1. Re:From Later in the Thread by Anonymous Coward · · Score: 0
      Not from Concurrent, no.

      Keep reading and you'll see:
      Comeau C/C++ 4.3.0, based upon EDG's above compliant 3.0,
      is now available for the Comeau online compiler, as usual...
  21. joke? by Anonymous Coward · · Score: 0

    i think, and hope, the parent was a joke.

  22. Ummm... by sterno · · Score: 1

    Intelligent comments? I thought this was slashdot :)

    --
    This sig has been temporarily disconnected or is no longer in service
  23. Their product is only a front end by reparteeist · · Score: 1
    An interesting point on this page:

    "The product Edison sells is basically just the front end. Someone needs to add a code generator, libraries, support tools, etc. to produce a complete compiler package."

    So while it is worth applauding a product which can handle the entire language, their work is not complete by any means. I sincerely hope they can produce the additional utilities that would make it worth implementing on. It is certainly promising.

    --
    If Bill Gates had a nickel for every time Windows crashed... Oh wait, he does.
    1. Re:Their product is only a front end by randombit · · Score: 2

      So while it is worth applauding a product which can handle the entire language, their work is not complete by any means. I sincerely hope they can produce the additional utilities that would make it worth implementing on. It is certainly promising.

      They won't. They never have. They don't need to. Other people pay them a *lot* of money to do it. In particular, I know that KAI C++ and Compaq's C++ compiler are both based on EGD. Probably there are 3 or 4 others, at least.

      EGD is a damn good optimizing compiler, too. I generates code that beats about anything out there.

    2. Re:Their product is only a front end by Matthew+Austern · · Score: 3, Informative
      In particular, I know that KAI C++ and Compaq's C++ compiler are both based on EGD.

      Yes, KAI and Compaq use the Edison front end. So do Comeau, SGI, Intel, and a number of other compilers. See EDG's site for a more complete list.

      Some of EDG's customers will release a compiler based on the new front end sooner than others, partly for business reasons (every company has different tradeoffs) and partly for technical reasons (for some companies, a new front end means an awful lot of integration work).

      I expect Comeau to be the first company to sell a compiler based on the new EDG front end: Greg Comeau has been very excited at being able to support export. I'll be surprised if it takes longer than a few weeks for the new Comeau compiler to come out.

  24. Sun and Java vs. C++ by sterno · · Score: 3, Interesting

    Sun is constantly talking about protecting the Java language for the sake of humanity. I find it rather amusing, by comparison, that C++ is so out there in the open that it took 5 years to actually get a complete implementation of it. Evidence that such tight controls aren't necessary to make a language stable and long lasting?

    --
    This sig has been temporarily disconnected or is no longer in service
    1. Re:Sun and Java vs. C++ by Anonymous Coward · · Score: 0

      Sun has objectives other than openness.

      Hadn't you figured that out? I figured it out back in the olden days when they refused to release a JDK for Linux. (they still wanted to force all desktops onto Solaris).

  25. Re:sean23007's IQ: 10? or less. I say less. by sean23007 · · Score: 1

    It's interesting that you would say such a thing, as it only draws attention to yourself. Your comment prompted me to look at your comment history, and it is quite evident that you are an ass that has little trouble making enemies, simply by your presence. Of course I am citing the fact that your highest rated comment on the most recent 24 is ZERO- and there is only one of those. Some large group of people really hates you. Perhaps you should start listening to people (which is what you accuse me of doing), and after having done this, perhaps kill yourself when you realize how utterly useless you are.

    --

    Lack of eloquence does not denote lack of intelligence, though they often coincide.
  26. Link by gazbo · · Score: 1
    Thank's for the google link, I'm having a great read.

    Seems the pet people have a sense of humour, which is more than can be said for the Linux clan. Bunch of fucking losers. The replies seem to be split between calling you a troll, insulting you, claiming you're funded by MS (fucknuts), and the obligatory clueless post that assumes you've told the truth and tries to argue around it. Beautiful.

    Actually, my favorite bit was cross-posting to alt.fan.british-accent. One troll from you and then the entire Linux dev team spam it to buggery!

    I rate that posting as an A

  27. did any of you read the spider-man bug story? by espilce · · Score: 1

    I couldn't help but laugh at the number of people complaining about detail-obsessed comic book/movie nerds, yet all I see so far in this thread are people bitching about the grammar and mistakes in the slashdot story!!

    Worst. Story. Ever.

    --
    :q!
  28. Stop Blaming MS Software Bugs! by Anonymous Coward · · Score: 0

    There will always be a tradeoff between CPU specific optimization and crossplatform portability. Ever hear of Goedels therom?

    1. Re:Stop Blaming MS Software Bugs! by GMontag451 · · Score: 2

      There is nothing in your comment that has anything to do with Godel's Theorem.

  29. Great. by MadFarmAnimalz · · Score: 2, Funny

    Wonder how long the man page is.

    The man page for gcc is bad enough... They could write something like "I love VB" somewhere in the midst of the thing and no one would ever get that far...

    Hmm.

    --
    Blearf. Blearf, I say.
    1. Re:Great. by norwoodites · · Score: 1

      don't use gcc's man page but use its info page, by `info gcc'

  30. Dude, learn assembly. by Anonymous Coward · · Score: 0

    Yay.

  31. Anyone Can Claim Standards Compliance, Prove It by Carnage4Life · · Score: 1, Interesting

    I've lost count of the number of times companies have claimed to be "standards compliant" only for this to turn out not to be the case when close scrutiny is applied to the product.

    A USENET thread claiming that a product is standards complaint has 0 credibility in my book regardless of who stated it. On the other hand passing the C/C++ User Journal's compiler roundup's set of conformance tests from Dinkumware, Perennial and Plum Hall with flying colors is worthy of comment.

    That said, EDG has long been producing the best C++ language compiler in the industry and if anyone could have achieved this I'd expect it to be them. However, running a front page story on Slashdot based on a USENET post lacks editorial judgement.

    1. Re:Anyone Can Claim Standards Compliance, Prove It by _|()|\| · · Score: 5, Informative
      On the other hand passing the C/C++ User Journal's compiler roundup's set of conformance tests from Dinkumware, [et al.]

      Well, P.J. Plauger did post on the thread: "The new EDG front end passes all the tests in the Dinkum C++ Proofer." I'd say that's a pretty good start.

  32. What is "standard?" by bcrowell · · Score: 1, Flamebait
    I just got through reading GNU Autoconf, Automake, and Libtool (copylefted, also available in print from New Riders). Doesn't it say something about the language's lack of standardization if you have to read a long technical book in order to understand how to use the tools that let you make your code portable? Internationally blessed standards are fine, but the time required for everyone to support standard n seems to be about 10 years, which is about the same as the time for standard n+1 to come out.

    C was originally designed as a low-level systems programming language that would let you get close to the hardware. It was envisioned as a slightly higher-level version of assembly language. For that kind of work, it's a miracle if you get any reusable code from one platform to the next. But how did C end up becoming the language of choice for application programming?? It's a disaster.

    C is like masturbation --- not very good, but always available.

    1. Re:What is "standard?" by Anonymous Coward · · Score: 0

      Hey, stop knocking on masturbation!

    2. Re:What is "standard?" by Anonymous Coward · · Score: 0

      You don't need to use GNU Autoconf, automake, and libtool to make portible code, you just need to program for portibility. This means that you can't assume that any non-standard libraries are on a system. If you're making a portable app, then you can't even assume that gmake is on the system.

      Second point C was designed to be portable.
      int i;
      for(i = 0; i 10000; i++) printf("BLAH\n"); should be valid C code on any platform. The problem is people make assumptions like: this program will always run on 32-bit integer systems, then when the code is moved to a system with 8-bit or 64-bit integers things go boom! This can be avoided by not making assumptions and following the standard.

      -jah

    3. Re:What is "standard?" by Anonymous Coward · · Score: 0

      for(i = 0; i 10000; i++) printf("BLAH\n");

      Too bad your code doesn't work either :-)

      How about for(i=0;i<10000;i++)? :-)

    4. Re:What is "standard?" by Arandir · · Score: 2

      Doesn't it say something about the language's lack of standardization if you have to read a long technical book in order to understand how to use the tools that let you make your code portable?

      Hey! I just finished reading that book too!

      It also has a chapter on C portability problems, and is quite instructive with regards to shell portability as well. C++ is hardly alone when it comes to quirks.

      Oh, and that book also considers "make uninstall" to be a "not a very useful feature."

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    5. Re:What is "standard?" by be-fan · · Score: 2

      Slashdot drops the symbol when posting as HTML ;)

      --
      A deep unwavering belief is a sure sign you're missing something...
    6. Re:What is "standard?" by elflord · · Score: 1
      Doesn't it say something about the language's lack of standardization if you have to read a long technical book in order to understand how to use the tools that let you make your code portable?

      Not at all. ANSI C is portable, and will compile on next to any modern compiler. There are a number of other reasons to use autoconf and libtool. The main for me are:

      • To provide compile time install options (eg --prefix=/foo/bar)
      • To provide build options (for example, debug versus release builds, Motif vs GTK vs console mode version of VIM, etc)
      • To detect non-standard third party libraries that your program requires, and check the versions.
      • To work out what commands to use to link and compile

    7. Re:What is "standard?" by Anonymous Coward · · Score: 0

      so write for (i=0; i<10000; i++)

    8. Re:What is "standard?" by be-fan · · Score: 2

      sigh... Maybe I was too subtle?

      --
      A deep unwavering belief is a sure sign you're missing something...
  33. No linux kernel compile, sorry by ZeekWatson · · Score: 2, Informative

    Uh, ze linux kernel isn't written in C++, it is written in C.

    Also, linux (kernel) uses a bunch of (proprietary to GCC :) extensions to C that no other compiler has, so this compiler hasn't a hope in hell of compiling the kernel.

    You need to realize that most low-level stuff isn't written in C++ (ie kernels, device drivers, TCP/IP stack, Apache, Perl, Python etc). C++ simply does not have the efficiency. I'm not saying C++ is slow, just that it isn't suitable for that kind of programming.

    1. Re:No linux kernel compile, sorry by Anonymous Coward · · Score: 0

      Um, dumbass, did you even read the link?

      The point is that this compiler can handle GCC extensions, as well as MSVC extensions, etc.

      And C is a subset of C++. GCC can work as a C compiler or a C++ compiler...

    2. Re:No linux kernel compile, sorry by __past__ · · Score: 1
      And C is a subset of C++.
      It's not. It's very similar, but there are incompatibilities.

      As well, there is C++ code in the Linux kernel. I guess the most accurate description would be that Linux is written in GCC. (Hey - that way, "GNU/Linux" suddenly makes a lot more sense!)

      GCC can work as a C compiler or a C++ compiler...
      Or as a Fortran compiler... or a Java compiler... or a Objective-C compiler... (Is the Ada frontend finished yet?)
    3. Re:No linux kernel compile, sorry by xphase · · Score: 1
      (Is the Ada frontend finished yet?)

      Yes, I use it here at work. I even find that some of its features are better than Rational's Ada compiler.

      For info see: Ada Core Technologies

      They are a private company that has done loads of work on gnat(GNU Ada compiler), and yes, the compiler is available for free, with source.

      --xPhase

      --
      The following sentence is TRUE. The previous sentence is FALSE.
    4. Re:No linux kernel compile, sorry by norwoodites · · Score: 1

      Actually the GNAT will be included in gcc 3.1
      read about it on http://gcc.gnu.org

    5. Re:No linux kernel compile, sorry by joib · · Score: 2


      You need to realize that most low-level stuff isn't written in C++ (ie kernels, device drivers, TCP/IP stack, Apache, Perl, Python etc). C++ simply does not have the efficiency. I'm not saying C++ is slow, just that it isn't suitable for that kind of programming.

      Uh.. I don't really agree with that. There is no inherent slowness in C++. Consider that many of the larger C projects use C in a kind of OO way (ie. structs with function pointers can be thought of as objects). There is no speed advantage in executing a function via a pointer in a struct compared to executing a non virtual method in a C++ object. The difference is that in C++ the compiler does a lot of the work for you behind the scenes, thus saving your time. The reason C is used lies mainly in the fact that many programmers are more used to it than C++. And for the projects you mention, they were all started quite a long time ago, when the GNU C++ really was nothing to cheer about. And also that C compilers exist for more platforms than C++ compilers, so if maximum portability is your priority number 1, plain C may be a better choice.

      In fact, I remember there were some discussion on the python mailing lists that a future version of python should perhaps be implemented in C++. Apparently it turned out that Jython (the implementation of python in Java) is a lot cleaner than the classical Cpython, largely because the OO features in Java made a much cleaner design possible.

  34. A replacement for C++ by Anonymous Coward · · Score: 3, Funny

    Hello Gentlemen,

    I'm a first year programming student at an Ivy League school and I've just finished my Visual Basic classes. This term I'll be moving onto C++. However I've noticed some issues with C++ that I'd like to discuss with the rest of the programming community. Please do not think of me as being technically ignorant. In addition to VB, I am very skilled at HTML programming, one of the most challenging languages out there!

    C++ is based on a concept known as Object Oriented Programming. In this style of programming (also known as OOPS in the coding community) a programmer builds "objects" or "classes" out of his code, and then manipulates these "classes". Since I'm assuming that you, dear reader, are as skilled at programming as I am, I'll skip further explanation of these "classes".

    Please allow me to make a brief aside here and discuss the origins C++ for a moment. My research shows that this language is one of the oldest languages in existance, pre-dating even assembly! It was created in the early 70s when AT&T began looking for a new language to write BSD, its Unix Operation System (later on, other companies would "borrow" the BSD source code to build both Solaris and Linux!) Interestingly, the name C++ is a pun by the creator of the language. When the first beta was released, it was remarked that the language would be graded as a C+, because of how hideously complex and unwieldy it was. The extra plus was tacked on during a later release when some of these issues were fixed. The language would still be graded a C, but it was the highest C possible! Truly a clever name for this language.

    Back to the topic on hand, I feel that C++ - despite its flaws - has been a very valuable tool to the world of computers. Unfortunately its starting to show its age, and I feel that it should be retired as COBOL, ADA and Smalltalk seem to have been. Recently I've become aquainted with another language that's quite recently been developed. Its one that promises to greatly simplify programming. This new language is called C.

    Although syntactically borrowing a great deal from its predecessor C++, C greatly simplifies things (thus its name, which hints at its simpler nature by striping off the klunky double-pluses.) Its biggest strength is that it abandons an OOPS-style of programming. No more awkward "objects" or "classes". Instead C uses what are called structs. Vaguely similiar to a C++ "class", a struct does away with anachonisms like inheiritance, namespaces and the whole private/public/protected/friend access issues of its variables and routines. By freeing the programmer from the requirement to juggle all these issues, the coder can focus on implementing his algorithm and rapidly developing his application.

    While C lacks the speed and robustness of C++, I think these are petty issues. Given the speed of modern computers, the relative sluggishness of C shouldn't be an issue. Robustness and stability will occur as C becomes more pervasive amongst the programming community and it becomes more fine-tuned. Eventually C should have stablity rivalling that of C++.

    I'm hoping to see C adopted as the de facto standard of programming. Based on what I've learned of this language, the future seems very bright indeed for C! Eventually, many years from now, perhaps we'll even see an operating system coded in this langauage.

    Thank you for your time. Your feedback is greatly appreciated.

  35. Missing Features List As Of Last Year by Carnage4Life · · Score: 5, Informative
  36. We need an engineer who knows the whole language! by WolfWithoutAClause · · Score: 1, Flamebait
    I mean, writing a compiler that can compile it is one thing, but i'm not sure that any reasonably percentage of the population actually can use it.

    In my opinion, and I've done a LOT of both C and C++; C++ is just a rotten language. I've nothing against a launguage that can run fast. I just don't think that in these days of >2Ghz processors that 99% of software engineers need that much speed most of the time; and forcing engineers to code in a particular style that enforces speed but impacts reliability is just crazy.I'm fed up with my software core dumping, memory leaking and inappropriately casting. I'm tired of switch statements that fall through by default. I really hate off by one errors blowing away the end of an array. And I really hate the way its so easy to write software that is susceptible to buffer overrun attacks.

    Let's face it, C++ is slightly warmed over 1973 technology, and it really, really shows.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  37. disbelief. by Anonymous Coward · · Score: 0

    perhaps he cannot believe that someone with a +1 bonus wouldnt suppress the bonus on a magnificant comment such as this and let it stan on it's own merrits :).especially considering the author was having the story read to him.

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

      If his comments could stand on their own merits, he wouldn't be attaching a name to them.

  38. Re: We need an engineer who knows the whole langua by wray · · Score: 4, Informative

    Frankly, your number pulling of "99% of software engineers" not needing the speed of C++ is just ridiculous and arbitrary. Look at the sheer number of complaints of about gnome, kde, mozilla, and related projects being to slow and you will realize that there is never enough speed. And those are just UI programs.

    I won't stoop to your pulling numbers out of the blue, but I would contend there is a great deal of scientific and research software that also need every bit of speed they can get. These programs alone must constitute way more than the 1% you have allotted. The software I am developing is in that category.

    Finally, when you speak as you have, you declare your ignorance loudly. Yes, C++ does not prevent you from making the kinds of mistakes that you refer to; but by learning good engineering techniques, you can avoid and prevent them yourself. Languages which do restrict you in this area *cough*java*cough* also restrict your creativity and power to accomplish your task. A civil engineer for example, uses techniques -- not restrictions -- to make his/her designs infallible; it is time software engineers step up to the plate and begin using solid techniques rather than blame the language.

    That being said, it is still important to use the right tools for the job, if speed is not a concern and you can acclompish the task with something safer and easier -- do it! C++, however is going to remain an important and key tool to accomplish many tasks in the future. Its speed, ability, and flexibility will assure its long life.

    --
    Guess what? I got a fever! And the only prescription.. is more cowbell!
  39. Re: We need an engineer who knows the whole langua by Anonymous Coward · · Score: 0


    So what are you coding in ? VB ?

  40. Mozilla C++ Portability Guide by Malc · · Score: 3, Informative

    You should take a look a the Mozilla C++ Portability Guide. It's quite depressing.

    1. Re:Mozilla C++ Portability Guide by Anonymous Coward · · Score: 2, Informative

      yes that IS depressing. Most of the things I do to help me keep bugs down are "dont's" and the things I dont do to keep bugs down are "do's". My favorite out of that list HAS to be #if 0. I never never never never ever use that. Why? Im lazy. It will never get put back in correctly. I would ask a better question when you use #if 0. Why in THE HELL are you checking in code that does not work? You obviously KNOW it doesn't work. Why are you checking it in? Open another file plop the code in there. Take it out of the other file and do not be so sloppy. Had one programmer that did the #if 0 'trick' quite a bit. He left the project (then the company). But we were stuck with LARGE chunks of code we were not quite sure how they hell it even compiled. Im talking 20 pages of commented out stuff. When we found those little gems we were ready to kill. If it doesn't work take it out... Extra junk laying around in a file makes a already tough job even harder!

    2. Re:Mozilla C++ Portability Guide by mce · · Score: 3, Informative

      While I agree that the state of C++ compilers could be a lot better (more power to EDG!), the Mozilla C++ Portability Guide is seriously outdated. It is by now 4 years old, and it shows. The claims about the HP compiler, for instance, apply to the previous compiler. No, not just the previous version, the previous compiler, for which HP has discontinued all support some time ago already. Actually, even back in April 98, HP's CC compiler was already being phased out and replaced by the much much better aCC one. Actually, we made the switch some time (I don't recall exactly) before the start of my current project in September of 1997.

    3. Re:Mozilla C++ Portability Guide by Anonymous Coward · · Score: 0

      The Mozilla C++ coding guide really doesn't tell you anything about the current state of language compliance. It's contents can basically be summed up in one sentence: Code to the least common denominator among C++ compilers dating from the 1995 time frame.

      I believe the intent is to make sure that Mozilla can be built on practically anything, including dusty old operating systems like BeOS, Solaris 2.51, etc. The downside is that it really ties the hands of programmers behind their backs. Rules 1-5 alone exclude about half of the language. If the guide were written to ensure portability across _current_shipping_ platforms, it would look markedly different.

      There are some other problems with the Mozilla coding guide too. First, as another poster mentioned, the claims made about specific compilers are so out of date, many were out of date when it was originally written. Also, some of the rules don't just reflect the need for backwards compatibility with old compilers, they're just plain really bad advice. For example, rules #15 and 26 in particular are simply WRONG and rules #14, 23, and 27 are senselessly limiting.

    4. Re:Mozilla C++ Portability Guide by Anonymous+Brave+Guy · · Score: 2

      I really dislike portability guides like that.

      We're using C++, but we're not supposed to use templates, exceptions, RTTI? Am I allowed to use a class, or do I have to write pure C with a .cpp extension, FFS?

      That sort of limitation was relevant five years ago. Today, the vast majority of compilers on all major platforms handle the vast majority of such functionality quite happily. Most rules banning templates, exceptions, etc. are out of date and inappropriate for the target readership. Don't use particularly devious template tricks, sure; it'll be another couple of years before it's safe to use Alexandrescu-esque techniques in code that must be portable across several compilers. But banning templates altogether (and presumably the whole STL and IOStreams libraries with them)? That's just silly.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    5. Re:Mozilla C++ Portability Guide by ejasons · · Score: 1

      My favorite out of that list HAS to be #if 0. I never never never never ever use that. Why? Im lazy. It will never get put back in correctly. I would ask a better question when you use #if 0. Why in THE HELL are you checking in code that does not work?

      I typically use it for code that is correct, but which was taken out by "forces beyond my control" (such as marketing deciding that they didn't want that feature. If I think there is a chance they will want it back, and I don't want to lose the code, I'll fence it out...
    6. Re:Mozilla C++ Portability Guide by eddeye · · Score: 1

      Actually I've gotten a good deal of Alexandrescu's Loki library to compile with MSVC, not exactly the most compliant compiler in the world. Sure everything based on typelists is missing, but I've got Singletons, Object Factories, Smart Pointers -- some good stuff.

      You can't go nuts with things like template template parameters, but I've managed to design some complicated policy-based classes of my own that work with MVSC.

      --
      Democracy is two wolves and a sheep voting on lunch.
    7. Re:Mozilla C++ Portability Guide by Anonymous Coward · · Score: 0

      This is also useful for compiler-bug workaround or other bailingwire/chewinggum solutions that will need to be reverted.

  41. On The Contrary by Anonymous Coward · · Score: 0

    Umm, on the contrary....
    I am a grad student at an ivy league school, having graduated from the same school as an undergrad, and I took a class on UNIX that included its history, its inner-workings, and learning to write my own shell from scratch. My professor has been an avid user and developer for UNIX for a VERY long time.

    You have it backwards. C was based off a language; B. C was created to write the UNIX operating systems as well as applications you mentioned. This was before OOP was in use (or possibly existed).

    As for speed, OOP allows for the faster CREATION of programs through the use of objects (re-usability and potential ease-of-coding). However, due to a large amount of overhead, ordinary C will often out-perform C++ in most cases.

    This post is in no way meant to be construed as mocking you or your knowledge. Perhaps we are both wrong, due to our sources of information (be it bias or otherwise).

    1. Re:On The Contrary by Morky · · Score: 1

      So at what point in an "Ivy League" education do they completely remove the sense of humor?

    2. Re:On The Contrary by Anonymous Coward · · Score: 0

      You just proved to the world how much of a fucking moron you are.

    3. Re:On The Contrary by Bjarke+Roune · · Score: 1

      Based on my detailed analysis of the data, I think there is good reason to suspect that it is during the the second week of the third semester that the surgeons move in and remove that piece of wetware in the student body.

    4. Re:On The Contrary by Anonymous Coward · · Score: 0

      I have a sense of humor, I just didn't read the whole thing.

      The reason I responded like that is because I actually know some CIS undergrads who's only programming skills involve simple VB apps. And they say wrong stuff like this all the time.

      The worst part of this is that some of the dumb-a$$'s are now TA's and are teaching similar "propoganda" to the students. While a good portion of them chuckle at their statements, some less-educated students accept their comments as pure fact.

      Now reading it all, I realize the guy/gal was sarcastic. My bad...

    5. Re:On The Contrary by Morky · · Score: 1

      I was just being a smart-ass. I've made the same mistake before. Just assume severe irony around here when someone sounds too stupid.

  42. Using the NULL pointer feature in C++ by Anonymous Coward · · Score: 0

    I have read that one good thing about Java is that it does not rely on pointers for memory management. Is that true?

    Also, I recently have begun a C++ class and on the subject of pointers, the textbook says this:

    Never dereference the "NULL" pointer.

    Well, after reading that, I decided that -- being a total programming geek after all :) -- the VERY FIRST THING I wanted to try to do was to "dereference" this NULL pointer.

    Unfortunately, the textbook did not go into detail about how this could be accomplished -- no surprise there.

    So can someone tell me what the probably outcomes of dereferncing &NULL would be? Is it really as dangerous as the book's author suggests?

    (It occurred to me that it might have a similar effect to something that I read about a while, back -- "Tao of Windows Buffer Overflow" -- an article by one of the founding members of the L0pht.

    So does anyone here know how to "dereference the NULL pointer"?

    I would appreciate some detailed sample code.

    1. Re:Using the NULL pointer feature in C++ by Anonymous Coward · · Score: 0

      int main(void)
      {
      char *APointer;
      char c;

      APointer=(char*)NULL;

      c=*APointer; // bang.

      }

    2. Re:Using the NULL pointer feature in C++ by Anonymous Coward · · Score: 0



      Is that C or C++?

    3. Re:Using the NULL pointer feature in C++ by Anonymous Coward · · Score: 0

      C and C++ are virtually identical. The only difference is that C++ adds a couple of keywords that C does not have.

    4. Re:Using the NULL pointer feature in C++ by norwoodites · · Score: 1

      both

    5. Re:Using the NULL pointer feature in C++ by Kenard · · Score: 1

      the comment ' //bang ' is the only part that is C++

      --
      (appended to the end of comments you post)
    6. Re:Using the NULL pointer feature in C++ by be-fan · · Score: 2

      Actually, what deferencing the NULL pointer does depends on the platform. In plain DOS, it reads whatever value is in memory location 0 (part of the interrupt descriptor table on x86), since DOS doesn't use memory protection. In protected memory OSs, deferencing the NULL pointer essentially becomes an access to memory address 0, and this address is always unmapped by the kernel so referencing it generates a fault, which the OS catches, and results in the application being killed. It doesn't warp spacetime or anything like that, if that's what you were hoping for...

      --
      A deep unwavering belief is a sure sign you're missing something...
    7. Re:Using the NULL pointer feature in C++ by elflord · · Score: 1
      the comment ' //bang ' is the only part that is C++

      C99 allows // comments

    8. Re:Using the NULL pointer feature in C++ by Anonymous Coward · · Score: 0

      but is C99 C?

  43. Info available on EDG's website by xphase · · Score: 4, Informative
    For those who don't trust a google discussion(like me), EDG's website has info here:
    Supported C++ and C Language Features

    This page also says:

    There is also a GNU C compatibility mode, which provides the extensions supported by GCC (version 3.0.1), along with various undocumented features and bugs. The compatibility is good enough that the front end can compile the Linux kernel and utilities. At present, there is no g++ mode, i.e., no way to enable GNU extensions and C++ mode at the same time.

    --xPhase

    --
    The following sentence is TRUE. The previous sentence is FALSE.
  44. Snappy answers to stupid bullet points by Anonymous Coward · · Score: 0

    1: You're both retarded
    2: You're both retarded
    3: You're both retarded
    4: You're both retarded

  45. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    Frankly, your number pulling of "99% of software engineers" not needing the speed of C++ is just ridiculous and arbitrary.

    I said most of the time , even within one program designers rarely need maximum speed at every point. My point is that the defaults of the language are almost uniformly dangerous. 95+% of the time, switch statements should not fall through; what's with making falling through the normal behaviour? I should put a 'nobreak' in to stop it breaking, not the other way around. I mean sure, I almost always remember it... these days... ;-)

    Yes, C++ does not prevent you from making the kinds of mistakes that you refer to

    No language can do that. C++ is the equivalent of a machine shop with no guards around any of the machinery. Sure, after you've been cut a few times you learn to move in a way that avoids the sharp bits; but here's an idea, why aren't there guards around them, that you can remove if you are doing something that needs them out of the way?

    Languages which do restrict you in this area *cough*java*cough* also restrict your creativity and power to accomplish your task.

    Oh yeah right. Lack of creativity and power. ;-) You must be the worst software engineer in the world if the language is getting in your way like that, but I don't buy that, you sound like you almost know what you're doing. But what's that smell? It's the Bull.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  46. Re: We need an engineer who knows the whole langua by Anonymous Coward · · Score: 0

    I'm fed up with my software core dumping, memory leaking and inappropriately casting. I'm tired of switch statements that fall through by default. I really hate off by one errors blowing away the end of an array. And I really hate the way its so easy to write software that is susceptible to buffer overrun attacks.


    It seems to me that the drawbacks you speak of here are all found in C many which have been addressed by new semantics and constructs available in the C++ standard. It seems you were compaing C++ to C ?

    Off by 1 errors? Are you using char *'s? Use std::string's. Are you using arrays? use STL containers and iterators (no more off by 1 errors)!

    Memory leaks ?? Learn to handle dynamic memory allocation, its not very hard, it just takes a little design and thought.

    C++ does not enforce the engineer to code for speed, it just allows it. An engineer should more often than not, code for reliabality and maintainability and optimize where performance issues arrise.

    I think you are being over critical, each language has its place, and all have their flaws, C++ may not be your cup of tea, but that does not make a bad language.

    My 2 cents...

  47. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 3, Insightful
    Look at the sheer number of complaints of about gnome, kde, mozilla, and related projects being to slow and you will realize that there is never enough speed. And those are just UI programs.

    That's more to do with algorithms than anything else. You can make almost anything faster with a better algorithms, and the two ings: caching and hashing. I bet you anything not one of those programs use the best algorithm.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  48. Re:Coffee Enema by Anonymous Coward · · Score: 0

    this is possibly the most interesting thing i've ever read on slashdot.

  49. Re: We need an engineer who knows the whole langua by Anonymous Coward · · Score: 1, Informative

    check Google, enter "The Programmers Stone". Download it, read it. Youre one of those "packers".

    Get a clue. Until then, shut up.

  50. Re: We need an engineer who knows the whole langua by wray · · Score: 1

    Here we go again with numbers from the blue.

    95+% of the time, switch statements should not fall through

    While I can't argue with your experience, mine is not this way. There are many instances where you have progressive types of options where you want to do something additionally when you hit the next option. If you have written a compiler (maybe even if you haven't) you will realize that writing a switch statement involves a jump table. Avoiding jumps really helps speed, so while your idea of using a nobreak option instead is intriguing, I personally like the way C++ encourages you to think about your switch statements to code them more efficiently. You can always just use if-then-else-ifs to avoid the fall through problems when you don't want to think about what you are doing.

    even within one program designers rarely need maximum speed at every point.

    While I agree completely with this, I have yet to see a good method of mixing this type of inherent safety one language provides with the raw speed of another. C++ perhaps has accomplished this the best. While not the safest, there are a lot of safety classes out there to use, and if those are too slow, you can still go the raw power.

    but here's an idea, why aren't there guards around them, that you can remove if you are doing something that needs them out of the way?

    If you are familiar with the Standard Library, then you know that there are many tools here to do just that. And, they still do them efficiently for most things. Still, if you want to avoid the guards you can.

    Oh yeah right. Lack of creativity and power.

    Yes, I phrased this a little poorly. (Surely with the creativity part) But, I was thinking in terms of multi-paradigm programming with generics and operator overloading. Both of these tools can increase expressiveness and decrease programming time. Java's original implemetors (I guess they are considering templates) did not include these things because they are too dangerous. I personally dislike this philosophy because, as I referred to, good techniques can help you avoid most, if not all of the dangers.

    --
    Guess what? I got a fever! And the only prescription.. is more cowbell!
  51. Please credit the fucktard by Anonymous Coward · · Score: 0

    Shut the fuck up, cocksnot. No one cares what your well-fucked blood-dribbling ass tulip has to say.

  52. Re: We need an engineer who knows the whole langua by wray · · Score: 1

    That's more to do with algorithms than anything else. You can make almost anything faster with a better algorithms, and the two ings: caching and hashing. I bet you anything not one of those programs use the best algorithm.

    While most likely true that these programs don't use the best algorithm, and better algorithms are always a better way to solve a problem; not everything is an algorithm. All I was thinking of was implementing the same ideas in different languages. When, given the same algorithms, a language provides safety at a cost of cycles, if your code is too slow, then you need to consider a different language. I guess my main beef was that you claimed first that C++ is a terrible language, and second that 99% of the programs don't need the speed offered. (You clarified your position on this somewhat)

    Finally, I still submit that not only does C++ offer greater speed and efficiency given the same algorithms than most languages, it offers greater expressiveness in accomplishing those ideas. No language should not get in the way of expressing algorithms. For me, C++ gets out of the way the best.

    --
    Guess what? I got a fever! And the only prescription.. is more cowbell!
  53. NOT A COMPILER by Anonymous Coward · · Score: 0

    First: I have personal experience with the EDG front end.

    Second: This is only half (arguably less) of a compiler. They provide a front end that parses and typechecks the entirety of standard C++. They DO NOT provide a standard backend optimizer or code generator. They do provide a C++ to C translation system. Directly compiling the C probably won't result in very efficient code.

    That being said, the EDG front end has some of the best documentation I've seen. It's available for non-commercial use to academics and researchers.

    A lot of people license and use it, (Microsoft is a client, although not for VC++). Their code is clean and very well commented. The authors actually ask you to report any typos you find in the comments!

    EDG can be viewed a lesson to open source developers. Creating extensive documentation and performing extensive testing are not frequently associated with open source development; in fact these activities appear to be frowned upon by a lot of developers I know.

    1. Re:NOT A COMPILER by Anonymous Coward · · Score: 0
      yes to many serious developers, what ranks highest on long term and/or large projects is consistency and comments (useful of course, not just 'uhhh, this class sucks') that include rational for why it is the way it is esp in the case of version evolution and architecture changes. However I hear (mostly online) those that continue to say things on the order of 'if they can't figure out the code than they have no business developing.' With that kind of ego laden illogic, it is no wonder that large commercial products will always suceed, regardless of marketing, and that is a damn shame. If these devs would stop posing and actually work then things would go a lot better. Instead they would rather take on the instance of the 'ComicBookGuy' and bask in their own ego.

      Hacked code is great for proof of concept, but for any serious development it requires diligence and discipline... two things that are often willfully and purposely lacking to keep up that 'image.'

      However, it is improving so perhaps many are seeing the light finally. There is a difference in knowing the syntax of a language and figuring out exactly what some other dev(s) where doing in a bit of code. Resorting to competency insults are the last resort of those who have nothing else to argue with. The time taken for the original team to document their project is saved many times over in the long run due the time it takes for others to basically reverse engineer the code.

  54. More information: what this really means by Anonymous+Brave+Guy · · Score: 4, Informative

    <sigh>Once again my story gets rejected when it contains more info than the one that gets posted. :-(

    To set the record straight, EDG do indeed produce C++ front end compiler tools, and it is these that have just been released.

    However, major C++ vendors including Comeau Computing use that in their compilers. Comeau already have a beta of their 4.3.0 compiler available at their on-line compiler. The full version is due later this month.

    Dinkumware have also announced a version of their standard library implementation to work with Comeau, which should be available shortly after the Comeau compiler is released. Apparently, it makes extensive use of export, but for little change in performance at compile-time.

    That makes their new library implementation a bit academic as far as Joe Developer goes. However, it's excellent news in general, because it shows that using export isn't going to entail a performance hit. We can finally write template code with interface and implementation properly separated out.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  55. C++: A dead language? by Anonymous Coward · · Score: 0

    Gentlemen, the time has come for a serious discussion on whether or not to continue using C++ for serious programming projects. As I will explain, I feel that C++ needs to be retired, much the same way that Fortran, Cobol and Perl have been. Furthermore, allow me to be so bold as to suggest a superior replacement to this outdated language.

    To give you a little background on this subject, I was recently asked to develop a client/server project on a Unix platform for a Fortune 500 company. While I've never coded in C++ before I have coded in VB for fifteen years, and in Java for over ten, I was stunned to see how poorly C++ fared compared to these two, more low-level languages.

    C++'s biggest difficulty, as we all know, is the fact that it is by far one of the slowest languages in existance, especially when compared to more modern languages such as Java and C#. Although the reasons for this are varied, the main reasons seems to be the way C++ requires a programmer to laboriously work with chunks of memory.

    Requiring a programmer to manipulate blocks of memory is a tedious way to program. This was satisfactory back in the early days of coding, but then again, so were punchcards. By using what are called "pointers" a C++ programmer is basically requiring the computer to do three sets of work rather than one. The first time requires the computer to duplicate whatever is stored in the memory space "pointed to" by the pointer. The second time requires it to perform the needed operation on this space. Finally the computer must delete the duplicate set and set the values of the original accordingly.

    Clearly this is a horrendous use of resources and the chief reason why C++ is so slow. When one looks at a more modern (and a more serious) programming language like Java, C# or - even better - Visual Basic that lacks such archaic coding styles, one will also note a serious speed increase over C++.

    So what does this mean for the programming community? I think clearly that C++ needs to be abandonded. There are two candidates that would be a suitable replacement for it. Those are Java and Visual Basic.

    Having programmed in both for many years, I believe that VB has the edge. Not only is it slightly faster than Java its also much easier to code in. I found C++ to be confusing, frightening and intimidating with its non-GUI-based coding style. Furthermore, I like to see the source code of the projects I work with. Java's source seems to be under the monopolistic thumb of Sun much the way that GCC is obscured from us by the marketing people at the FSF. Microsoft's "shared source" under which Visual Basic is released definately seems to be the most fair and reasonable of all the licenses in existance, with none of the harsh restrictions of the BSD license. It also lacks the GPLs requirement that anything coded with its tools becomes property of the FSF.

    I hope to see a switch to VB very soon. I've already spoken with various luminaries in the *nix coding world and most are eager to begin to transition. Having just gotten off the phone with Mr. Alan Cox, I can say that he is quite thrilled with the speed increases that will occur when the Linux kernel is completely rewritten in Visual Basic. Richard Stallman plans to support this, and hopes that the great Swede himself, Linux Torvaldis, won't object to renaming Linux to VB/Linux. Although not a C++ coder himself, I'm told that Slashdot's very own Admiral Taco will support this on his web site. Finally, Bjarne Strutsoup is excited about the switch!

    Thank you for your time. Happy coding.

    1. Re:C++: A dead language? by elflord · · Score: 1

      You're that "Egg Troll" guy who cross-posts trolls to all the comp.lang groups, right ? Well, nice troll. Cheers,

    2. Re:C++: A dead language? by Anonymous Coward · · Score: 0
      While I've never coded in C++ before I have coded in VB for fifteen years, and in Java for over ten, I was stunned to see how poorly C++ fared compared to these two, more low-level languages.
      that's interesting, because java wont celebrate it's 10th birthday until May 23, 2005 - am i to assume you were using "oak" before that ?!??!
      C++'s biggest difficulty, as we all know, is the fact that it is by far one of the slowest languages in existance, especially when compared to more modern languages such as Java and C#.
      you have *GOT* to be kidding me. what do you think all the worlds' operating systems are written with? most good compilers go straight to binary. and some of these compilers put out some pretty efficient binary. i used to a boat-load of assembly development, and some of the cutting edge c-compilers were putting out efficient code.

      java is interpreted, although you can generate
      native binaries. vb is in the same boat, but
      its object-based, which is fairly wimpy. i cant
      talk about c#, all i know is that it was created
      as a marketing language to compete with
      java (cause microsoft couldnt shut it down).
      Although the reasons for this are varied, the main reasons seems to be the way C++ requires a programmer to laboriously work with chunks of memory.
      a c programmer worth his salt will know exactly how to use his chosen language. it's the typical 9-5 programmer that hasnt a clue.
      Requiring a programmer to manipulate blocks of memory is a tedious way to program. This was satisfactory back in the early days of coding, but then again, so were punchcards.
      that's not even a comparison, so try something else. learning how to release allocated memory is child's play - you just have to be an efficient developer.
      By using what are called "pointers" a C++ programmer is basically requiring the computer to do three sets of work rather than one. The first time requires the computer to duplicate whatever is stored in the memory space "pointed to" by the pointer. The second time requires it to perform the needed operation on this space. Finally the computer must delete the duplicate set and set the values of the original accordingly.
      you are obviously clueless, based on your previous
      paragraph. you dont "duplicate" memory so that a pointer can point to something. memory is first
      allocated, either on the heap or the stack (i hope
      i'm not using language that is unfamilar), and then a pointer is created, either on the stack or heap, so that you can access the memory it is pointing to. pointers are the most efficient way to access memory on the heap (and stack), short of reverting to assembly language. pointer arithmetic and the use of a pointer to "walk" memory locations is waaaaay more efficient then, say, using array offsets.
      When one looks at a more modern (and a more serious) programming language like Java, C# or - even better - Visual Basic
      vb - what a joke. like i said, i've never dealt with c#, so i cant talk to it. and java is efficient for
      OTHER reasons - it's not faster than 'c'. there is
      a lot of plumbing in java that is included out of
      the box, is truly object oriented, and includes a
      garbage collector. but the garbage collector is
      very inefficient, in time-critical applications. you can get garbage collectors for c++ and c also.
      that lacks such archaic coding styles, one will also note a serious speed increase over C++.
      i'll tell you what, let's decide on a back-end, speed critical application to run on a real OS, like Linux or Unix - you do it in VB, and i'll do it in C++, and we'll do some speed runs and see what the outcome is.
      Having programmed in both for many years, I believe that VB has the edge.
      BWA HAHHAHHAHAHA ... thanks, i was feeling a little blue, but now i'm smiling :))
      Not only is it slightly faster than Java its also much easier to code in. I found C++ to be confusing, frightening and intimidating with its non-GUI-based coding style.
      like i said, you havent a clue about the language because of that typical microsoft mentality: "if it dont have a GUI, i'm lost"
      Furthermore, I like to see the source code of the projects I work with. Java's source seems to be under the monopolistic thumb of Sun much the way that GCC is obscured from us by the marketing people at the FSF.
      again, you havent a clue. what, do you think that sun owns all the code you write??? sheesh.
      I hope to see a switch from C++ to VB very soon. I've already spoken with various luminaries in the C++ coding world and most are eager to begin to transition.
      BWA HAHAHAHAHAHA. come on come on,
      *names* please - what "luminaries" in the
      industry are dying to move from c++ to vb.

      the really sad part of it is that much of the discussion is used seriously by java advocates. i ihave heard the java zealots actually say that java is typically faster than c or c++. at that point i shake my head an assume nothing can be said to someone so confused.
    3. Re:C++: A dead language? by Anonymous Coward · · Score: 0

      Thank you for playing. Come again.

    4. Re:C++: A dead language? by Anonymous Coward · · Score: 0

      pardon my complete offtopicity but is it usually considered as taking the bait if you reply to troll with another?

  56. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    If you have written a compiler (maybe even if you haven't) you will realize that writing a switch statement involves a jump table. Avoiding jumps really helps speed,

    Whether a switch is slow or not is both compiler and processor dependent; although most compilers don't optimise this much, switches are usually slow. But I don't see what that has to do with the syntax of the language.

    so while your idea of using a nobreak option instead is intriguing, I personally like the way C++ encourages you to think about your switch statements to code them more efficiently.

    So you like the naked sharp spinning things because the pending death concentrates the mind? You're perverse if you don't mind me saying.

    You can always just use if-then-else-ifs to avoid the fall through problems when you don't want to think about what you are doing.

    You could, but that's horrible.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  57. Re: We need an engineer who knows the whole langua by mikeb · · Score: 2, Insightful

    > I'm fed up with my software core dumping, memory leaking ... [etc.]

    Uh? C does that, unless you code REALLY carefully. C++ - unless you choose to use it simply as a C compiler - gives you the tools to eliminate precisely those irritating errors. Well-designed classes give you the ability to move to a higher level of abstraction so that stuff isn't even on the agenda. Even cursory knowledge of strings, vectors and maps/hashes allows you (in my own experience) to get at least one order of magnitude more reliability into your software and with exception handling, provides the mechanism for dealing with the errors when they do occur.

    If you choose to use a C++ compiler to compile C, then there is little point. Moving up to what (IMHO) C++ was intended to provide puts you somewhere different altogether. But the idioms are different entirely; idiomatic C++ is a *very* different language from C. It's not perfect (it's far too big) but if you need a C-like tool and care about reliability and freedom from overruns, memory leaks and the like, it's a very good tool for the job. And it's a lot easier to get stuff right up at that abstraction level too. You get the airbags and ABS braking :)

  58. The Language is Complicated by Greyfox · · Score: 2, Insightful
    Because it lets you do complicated things. Part of the problem is I don't think anyone (including Stroustrup) have any idea of all the complicated things you can do with it. I'd be surprised to find a university course on the topic that even scratches the surface of what is possible with it. A major part of the problem has been what this story's about; no compiler implemented all the language features and the features there were implemented were not implemented correctly.

    If you want to see some of the really weird thigns you can do with the language, check out Andre Alexandrescu's "Modern C++ Design." You might also want to look at the signal system that gtk-- uses. Yes, it can lead to a twisty maze of templates, but it also affords some very powerful type checking, which I miss when moving to languages like Scheme or Java.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

    1. Re:The Language is Complicated by stripes · · Score: 2
      Because it lets you do complicated things. Part of the problem is I don't think anyone (including Stroustrup) have any idea of all the complicated things you can do with it.

      That at least use to be true. In interviews the guy that designed the STL (Steponov?) shocked Stroustrop -- he didn't think anything like the STL could be implemented in C++ (and it turns out he was partly right, there were some minor language changes to make the STL work, and some bigger changes to make it work better/be simpler to implement).

      If you want to see some of the really weird things you can do with the language, check out Andre Alexandrescu's "Modern C++ Design." You might also want to look at the signal system that gtk-- uses.

      I'm just forced to add "Me too!" here. I miss gtk--'s signal system when using ObjC or pretty much anything else...and Modern C++ design is just chock full of interesting ideas that will totally drive maintance programmers apeshit.

    2. Re:The Language is Complicated by Anonymous Coward · · Score: 0

      Have you tried ML? It lets you do all those complex type-checking things, except its type system actually follows the principle of least astonishment. The main argument against it is the complexity of the polymorphic type system, but if you can handle complex c++ templates then ML types should be a piece of cake.

      There's a difference betwween being complicated and being inelegant. Let macros be macros..

    3. Re:The Language is Complicated by pi_rules · · Score: 3, Insightful

      Part of the problem is I don't think anyone (including Stroustrup) have any idea of all the complicated things you can do with it.

      Quite true... if memory serves me right in The C++ Programming Language Stroustrup actually says he does not consider himself an expert at C++. It's pretty much humanly impossible (IMHO) to know the entire language and make proper use of it 100% of the time. I smile to myself everytime I see young programmers fresh out of college calling themselves C++ experts.

    4. Re:The Language is Complicated by Anonymous Coward · · Score: 0

      Hey Yogi,

      What is the matter with the STL? Just because Elric doesn't like it, doesn't mean that it won't s00x your soul.

    5. Re:The Language is Complicated by Bouncings · · Score: 2

      I think you're missing the point. "Doing complex things" is not the gaol of a good language -- "doing complex things simply" is. And those of us who have waded through "powerful" C++ code can all attest to how refreshing it is to see normal structured C code. :)

      --
      -- Ken Kinder ken@_nospam_kenkinder.com http://kenkinder.com/
    6. Re:The Language is Complicated by pyrrho · · Score: 1

      I think you're missing the point. "Doing complex things" is not the gaol of a good language -- "doing complex things simply" is.


      I so disagree. (1) automatically the best language question is relative to a problem space... right language for the job, but that's a cop out so (2) If you are pushing the limits of what can be done, and you should be whatever you are focussing on, since this is such a young unexplored type of engineering, then you need a language flexible enough to allow you to change the way you do things.

      I would like to see these changes to C++:

      (1) arbitrary operator definition: this would allow better control over operators and not imply relationships already played by the built in operators. Also, I hope this will silence complaints about how confusing operator overload it, because the standard operators would only be used for the appropriate meanings... (e.g. + is addition/concatination, ++ is increment or advance in list or step to next item (for pointers).) Probably more complaints though.

      (2) Binary standards for multiple inheritance structures, and common name mangling. Binary incompatibilityland.

      (3) someone needs to write sufficient operator overloads to install a garbage collection system as integrated as possible to the standard way of handling pointers etc. There is a small chance this will be directly useful, but think of all the Java programmers that would then praise C++. Worth it just for PR!

      And those of us who have waded through "powerful" C++ code can all attest to how refreshing it is to see normal structured C code. :)

      --

      -pyrrho

    7. Re:The Language is Complicated by cduffy · · Score: 1

      A good language doesn't need to be complicated to do complicated things. Indeed, most of the time, if you're using complicated features, your design's too complex and should be refactored down.

      Complicated things can and should be done in the simplest manner that makes sense in the context of your project. If a new guy comes in who can't understand any individual piece of your code within a few days of showing up (even if it takes weeks or months to understand how it all works together), you did something wrong. Certainly, the larger work may need to be complicated -- but every individual piece should be simple, well-defined (documentation and test cases get a whole lot easier if your project is broken down into small, simple pieces!) and thus maintainable.

      Even the simplest Turing-complete language can describe every single complicated and complex thing that the most complicated language can do. Additional complexity in a language is thus never needed for additional complexity in a project -- except for the sake of making that project easier to write, debug, understand, maintain, &c. If the complexity you're adding detracts from that goal rather than assisting it, then it shouldn't be there.

      My last project included code written in Java [the bulk of it], Scheme [the test suite] and Python [assorted surrounding admin tools]; I certainly agree that different situations call for different levels of complexity. Those I consider among the best of us, however (and I make no claim to be among them!) are those who can look at a complex problem and see a very simple solution. Language complexity is not a solution. Language complexity is a problem in and of itself.

    8. Re:The Language is Complicated by unDees · · Score: 1

      And those of use who have waded through reams of "normal" 600-line structured C functions can all attest to how refreshing it is to see expressive C++ code whose intent can be made clear in just a few lines.

      --
      "I call a baby goat a 'goatse.'" -- my non-Internet-savvy 6-year-old stepdaughter
  59. Re: We need an engineer who knows the whole langua by be-fan · · Score: 2

    Hell, given gnome and kde, developers these days can't write acceptably fast software even in C/C++ (even on my 1.5GHz Athlon XP, KDE 3.x and GNOME 1.4 are pushing the limits of 'acceptable'), so maybe if they switched to languages that would allow them to add stupid features even more quickly without borking performance, software might even get faster! Seriously, though, it's all relative. You use whatever language you're comfortable with. Personally, I don't find C++ all that ardous, and with STL and whatnot, its as easy to write C++ applications as Java apps. When I need to interface at the shell level, however, I tend to use Perl, which can't be beat for its quickness and utility. But if you don't like C++, that's fine. Go use Java or something. I personally won't touch Java with a ten-foot pole, but then again, I grew up with C++. Of course, for some things, C/C++ is unavoidable. Kernel stuff, for example. Even C++ is almost too high-level for kernel development (lots of runtime support needed).

    --
    A deep unwavering belief is a sure sign you're missing something...
  60. It's a pity that the standard is broken. by Ungrounded+Lightning · · Score: 4, Insightful
    Congratulations to the Edison Design Group. An awesome job.

    It's too bad that the standard itself is broken...

    In case you're interested: The issue is a deceptively fine point in constructor/destructor semantics. The current standard allows behavior that massively breaks a bunch of stuff you'd have been able to do if it had required behavior that conformed with the rest of the philosophy of the language. It is this:

    You have a class base class with,

    a virtual member function and,

    a constructor that,

    exports a copy of the pointer to the instance under construction (which is stored externally), and

    a derived class with,

    a member variable of a class-with-construction type, and

    an overriding of the virtual function, and

    the constructor of the derived class's member variable (or something it calls, or some other member-variable initialization) gets hold of the pointer and,

    calls the virtual member function.
    Does it get the base class version, derived class version, or go wonky?

    Similarly during DEstruction of the member variables (i.e. after the derived class destructor but before the base class destructor).

    My claim is that the standard SHOULD explicitly specify the behavior as follows:

    The result of a virtual member function call is defined from the execution of the first line of any constructor of the class through the execution of the last line of the destructor, at the most-baseward class where the virtual member function has a defined behavior (unless a more derived class overrides the function to again be pure virtual, and this is allowed).

    The result of a virtual member function call to a virtual member function that is overridden in a derived class is the derived class behavior if the function is called during or after the execution of the first line of any constructor and before or during the execution of the last line of the destructor (unless a more derived class overrides the function again), the base class behavior if called before the first line of a derived class constructor or after the last line of the derived class destructor.

    In other words: Member variable constructors/destructors (and everything else executing at that time) "see" the base class.

    Instead we have this: With respect to calling virtual member functions during construction the early language definition and first ANSI standard said the behavior was undefined. The "final" standard essentially says "don't do that". I'm not sure what current compilers do. But when I checked about ten years ago, of the four binary combinations of whether constructors and destructors got it "right" or "wrong":

    cfront (and cfront-derived compilers at Sun and SGI) got it "wrong" one way.

    three compilers for PCs got it "wrong" a second way.

    g++ got it "wrong" the third way.

    Now the semantics I've described are very powerful and create a consistent object model.

    Up to the beginning of the user-written code of the constructor through the end of the user-written code of the destructor the instance is a collection of components - base classes, member variables - which have their own internally-consistent behaviors. It is wrong to execute the derived-class member function, because the derived class instance doesn't exist yet. But it is right to execute the base-class member function, because the base class DOES exist and IS initialized.

    After the execution of the constructor and before the execution of the destructor the derived-class instance is a fully-constructed and initialized member of the derived class. It might later be hammered into a new shape by serving as a component of a more-derived class, but for now it's consistent.

    During the constructors the components are pulled together into a whole, and during the destructor they're disassembled into their components. But the constructors and destructor are aware of the state of the assembly, and can use care not to let a derived-class virtual member function be executed until everything it depends on is ready, or co-operate with it by passing it flags to inform it of construction progress.

    I won't go into all the things this enables. But I will note that it would make C++ more consistent and more powerful for object-oriented programming than other contenders, which also do this "wrong". (For instance: Smalltalk has the derived-class ("subclass") behavior during the base-class ("superclass") construction. This risks breaking the consistency of already-debugged construction code whenever a method is overridden and requiring those coding to constantly recheck code outside their new class' modularity boundary.)

    Since the behavior I want is a legal option within the standard, perhaps the Edison Design Group might be willing to give me a compiler switch or pragma ("object_construction_semantics"?) to cause their compiler to generate it?

    Pretty please?

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:It's a pity that the standard is broken. by Anonymous Coward · · Score: 1, Insightful

      see [class.cdtor.3]

      "When a virtual function is called directly or indirectly from a constructor (including from the mem-initializer for a data member) or from a destructor, and the object to which the call applies is the object under construction or destruction, the function called is the one defined in the constructor or destructor's own class or in one of its bases, but not a function overriding it in a class derived from the constructor or destructor's class, or overriding it in one of the other base classes of the most derived object (_intro.object_)."

      Thus virtual function calls inside constructors/destructors are perfectly well defined in the C++ standard. If C++ did not have
      the above section, then every method in every class would need to prepare for case where someone calls virtual functions inside constructor and add explicit tests for not-yet-initialized data. Currently it is well defined and virtual functions can safely expect that the object (of the class type) has been correctly initialized. The _only_ case where you get into problems is pure virtual functions that has no implementations.

      Some _compilers_ are known to implement this issue wrong. GCC handles it correctly! The C++ standard is just fine.

    2. Re:It's a pity that the standard is broken. by Sax+Maniac · · Score: 2
      Mod this parent up! Right on.

      Also note that anyone trying to do complex construction semantics (e.g., virtual initialization) or interaction with objects (e.g., registering this with another object registry and throwing multiple, possibly virtual inheritance into the mix, and trying to deal with the brokenness of various complilers there is only one workable solution: two-phase construction.

      For example:

      • Make your constructors private, and only do minimal intitialization (set values to zero, no subobject initialization or sending this off to another).
      • Write a separate initialization function called that can be called to really init the object.
      • Write a public static method that creates the object with the constructor and runs the init routine.
      This causes the entire virtual table to be done before you attempt to call any virtual functions, or hand this off to other objects that might try to call virtual functions before it's done cooking. That sidesteps the problem of compilers screwing it up.

      --
      I can explanate how to administrate your network. You must configurate and segmentate it, so it can computate.
    3. Re:It's a pity that the standard is broken. by Ungrounded+Lightning · · Score: 2

      When a virtual function is called directly or indirectly from a constructor (including from the mem-initializer for a data member) or from a destructor, and the object to which the call applies is the object under construction or destruction, the function called is the one defined in the constructor or destructor's own class or in one of its bases,

      In other words:

      When a virtual function is called from the constructor of the derived class it MAY get the behavior of its own class or it MAY get the behavior of the base class.

      Which is even more broken than I described.

      I claim the standard SHOULD say that a constructor or destructor MUST get the version of the virtual function that is a member of ITS OWN class - the class of which this constructor or destructor is a part. It gets a BASE class virtual function if and only if there is no overriding definition in this class.

      (A constructor / destructor and a virtual member function OF THE SAME CLASS can interact through a member variable so the member function can selectively delegate to its base class version if necessary. A constructor/destructor can NOT interact with the BASE CLASS version of the member function to promote its behavior.)

      On the other hand, when the virtual function is called from the mem-initializer for a member object, I claim the standard SHOULD require that it MUST get the behavior of the BASE class version of the member function. More importantly, I claim that the constructors and destructors of MEMBER OBJECTS of the derived class should also invoke the BASE class' version of the virtual member function.

      (A derived-class virtual member function will typically depend on member state that has not been fully initialized. And it can not even defer to the base-class version because it can't trust the state of any member variable to flag the necessity.)

      Of course the standard is correct in saying that it should NOT get the behavior of a further-derived class of which the class containing the constructor, destructor, mem-initializer, or member object is a base.

      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    4. Re:It's a pity that the standard is broken. by Anonymous Coward · · Score: 0

      I dont understand.

      > claim the standard SHOULD say that a constructor
      > or destructor MUST get the version of the virtual
      > function that is a member of ITS OWN class"

      But this is exactly what it says. (though, I do not know what your concepts "its own class" means. Lets see situation like this:
      class B { virtual void f(); };
      class C : public B { C(); virtual void f(); };
      class D : public C { virtual void f(); };

      What this says:
      C::C() calling f(); will ALWAYS get C::f(), not
      anything else. Never will it call B::f(), nor will it ever call D::f();

      The std says B::f() is considered only if C::f() does not exists. (== C::f() is alias of B::f())

      Please show code that explains the problem. I think the above code works exactly how it should work.

    5. Re:It's a pity that the standard is broken. by Ungrounded+Lightning · · Score: 2
      The std says B::f() is considered only if C::f() does not exists. (== C::f() is alias of B::f())

      I read the snippet you posted to mean that C::C() had the option of calling B::f() or C::f(), and got off on a rap on THAT being broken in my second post. I will be more than happy to stand corrected on that issue. What you describe is what I WANT the standard to say for that case.

      But my real gripe is this:
      class A *aPrtToA;

      class X { X(); ~X() };

      class A { A(); virtual void f(); };
      class B : public A { B(); virtual void f(); };
      class C : public B { X anX; C(); virtual void f(); };

      A::A() { aPtrToA = this; }
      X::X() { aPtrToA->f(); } // C::f() or B::f()?
      X::~X() { aPtrToA->f(); } // C::f() or B::f()?
      I claim the standard should require that when anX is constructed or destructed B::f() is called. As I recall the "final" version of the standard it essentially said "don't do that, the behavior is undefined".

      I don't know what current production compilers do. But when I looked at the stuff current about 10 years ago:
      - Some would do C::f() and B::f()
      - Some would do B::f() and C::f()
      - Some would do C::f() and C::f()
      - None would do B::f() and B::f() (IMO the "correct" thing to do).
      --
      Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    6. Re:It's a pity that the standard is broken. by Anonymous Coward · · Score: 0
      If you're being that shit-stupid and doing things of that complexity, it serves you right that your crap doesn't work. And I do mean crap, because the kind of stuff you're talking about doing has no business running anywhere that is anything more than an academic exercise.

      Any pompous jackass can come up with a complex solution to a difficult problem. If you're really smart you'd come up with a simple and maintainable solution.

    7. Re:It's a pity that the standard is broken. by Anonymous Coward · · Score: 0

      Well, if you aren't using virtual functions you aren't really writing C++ at all. This is hardly exotic stuff. The only way I know of to avoid this defect in the language is to pass function pointers into constructors, cut'n'paste all the init code into nonvirtual functions (and hope nobody wanted to override them), or use that brain-damaged Microsoft style where each class has a "constructor" that does nothing useful and you have to call some other method (which the compiler won't automate!) to make the instance usable.

  61. Re: We need an engineer who knows the whole langua by be-fan · · Score: 2

    Actually, with a good implementation of the STL (SGI's for example), fast, standard, easy-to-use data structures and algorithms become a prime selling point for C++.

    --
    A deep unwavering belief is a sure sign you're missing something...
  62. Re: We need an engineer who knows the whole langua by be-fan · · Score: 2

    So you like the naked sharp spinning things because the pending death concentrates the mind? You're perverse if you don't mind me saying.
    >>>>
    Umm, it's actually scientfic fact that sharp spinning things concentrate the mind. Thing about it: when are you most attentive? Going 95mph on the freeway, or sitting in traffic going 15mph? Danger does sharpen attention.

    --
    A deep unwavering belief is a sure sign you're missing something...
  63. Re: We need an engineer who knows the whole langua by Anonymous Coward · · Score: 0
    I'm fed up with my software core dumping, memory leaking and inappropriately casting. I'm tired of switch statements that fall through by default. I really hate off by one errors blowing away the end of an array.

    You need to take a programming course.

  64. Actually C++ is MORE efficient that C by Anonymous Coward · · Score: 0

    > C++ simply does not have the efficiency.

    ummm... I had to deflate your little universe of naivity, but C++ has been proven to produce code faster than C and faster even that Fortran on numerical benchmarks, and this was years ago. The problem is that BAD C++ code can be slower than good C code.

    1. Re:Actually C++ is MORE efficient that C by himi · · Score: 2

      Using C++ funky bits makes it much harder to control exactly what code the compiler produces, regardless of whether it's more efficient or not. You also need a runtime library for a lot of things. Those are the two main reasons C++ /isn't/ used.

      The control thing probably sounds like a red herring, but in kernel land knowing exactly what your code is doing is extremely important - every cycle really does count. Particularly in the core kernel, you often see strange and confusing constructs that are in there simply because they've been shown to produce faster code. And this isn't some kind of he-man "I can write more gotos than you!" crap - people actually sit down and look at the asm output from bits of code and decide which version is best.

      That's the main reason why the kernel is so conservative about what compilers it builds on - there's code in there that relies on specific behaviour of gcc extensions to achieve the exact results desired. This probably sounds like a bad thing, but this is an OS kernel - performance is /everything/, and when the compiler you're targetting is as portable as gcc, it's not even that big an isue for portability.

      Kernel coding is /not/ like userspace coding. The code tends to look much the same, but you operate under constraints that make the details vastly different, and which make things like C++ difficult propositions.

      himi

      --

      My very own DeCSS mirror.
  65. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    I said most of the time , even within one program designers rarely need maximum speed at every point. My point is that the defaults of the language are almost uniformly dangerous. 95+% of the time,

    This claim has no factual basis.

    switch statements should not fall through; what's with making falling through the normal behaviour?

    Using switch statements in C++ is not "default behaviour". They are rarely used, and serve mostly as a C compatibility tool. switch can nearly always be replaced by table lookup or polymorphism, and both of these things (tables and polymorphic objects) are supported by the language.

    but here's an idea, why aren't there guards around them, that you can remove if you are doing something that needs them out of the way?

    C++ was not designed from scratch, it was constrained by C compatibility. For the most part, this is the reason. Basically, getting rid of "sharp bits" wasn't the primary goal of the language.

  66. Um, i answered this one already by Anonymous Coward · · Score: 0

    This post seems very familiar. In fact, it's a word-for-word repost of a post from a previous story.

    Follow the link i gave.. my response is the second response, #3447013. It answers your question quite nicely.

    1. Re:Um, i answered this one already by Anonymous Coward · · Score: 0


      How come you always post as AC?

  67. This is not how GPL works by MrByte420 · · Score: 2, Informative

    >harsh restrictions of the BSD license. It also lacks >the GPLs requirement that anything coded with its >tools becomes property of the FSF. You have this totally backwards. The GPL only says that if you modify the source code of a GPL program amd redistribute it - you must make the orginal code available to the end user. What you use a GPL'd piece of software for is up to you. Furthermore GPL'd software is NOT property of FSF unless you decide to give them those rights. otherwise the copyright is held by the orginal author.

    --
    If religous zealots don't believe in Evolution, then why are they so worried about bird flu?
  68. Oh yeah... by sterno · · Score: 1

    I figured it out, just enjoying the opportunity to point out evidence that they are completely full of it. It's a shame that they have to be so stupid about it because I really like Java.

    --
    This sig has been temporarily disconnected or is no longer in service
    1. Re:Oh yeah... by alienmole · · Score: 1

      Don't let Sun stop you from using Java. It's not like they can *really* control it any more.

  69. So can this compiler finally handle THIS... by Lethyos · · Score: 2

    I cannot even begin to count how many times I have wanted to do something along these lines. Keeping everything nice and separated. Instead, the only way to make this work is to include Foo.cpp in main.cpp, which is well, retarded. C++ needs some serious work with templates... so is something like this fixed? Or does it contain some abiguity that I am not aware of?

    /* Foo.h */
    template<class T>
    class Foo {
    public:
    Foo(void);
    void doSomething(void);
    T bar;
    };

    /* Foo.cpp */
    #include"Foo.h"
    template<class T>
    Foo<T>::Foo(void) { /* Do magic here. */ }
    template<class T>
    void Foo<T>::doSomething(void) { /* Do magic here. */ }

    /* main.cpp */
    #include"Foo.h"
    int main(int argc, char *argv[]) {
    Foo<int> *foo;
    foo=new Foo<int>();
    foo->doSomething();
    }

    --
    Why bother.
    1. Re:So can this compiler finally handle THIS... by abdulla · · Score: 1

      That's whay export allows you to do, so I believe it's something like this: export temlate class my_export { ... };

    2. Re:So can this compiler finally handle THIS... by abdulla · · Score: 1

      If only i could spell, I meant template, and the default HTML styling destryoed the line breaks.

    3. Re:So can this compiler finally handle THIS... by Anonymous Coward · · Score: 0
  70. The GPL: Protection or Theft? by Anonymous Coward · · Score: 0

    Hello,

    Consulting for several large companies, I'd always done my work on Windows. Recently however, a top online investment firm asked us to do some work using Linux. The concept of having access to source code was very appealing to us, as we'd be able to modify the kernel to meet our exacting standards which we're unable to do with Microsoft's products.

    Although we met several technical challenges along the way (specifically, Linux's lack of Token Ring support and the fact that we were unable to defrag its ext2 file system), all in all the process went smoothly. Everyone was very pleased with Linux, and we were considering using it for a great deal of future internal projects.

    So you can imagine our suprise when we were informed by a lawyer that we would be required to publish our source code for others to use. It was brought to our attention that Linux is copyrighted under something called the GPL, or the Gnu Protection License. Part of this license states that any changes to the kernel are to be made freely available.

    Unfortunately for us, this meant that the great deal of time and money we spent "touching up" Linux to work for this investment firm would now be available at no cost to our competitors.

    Furthermore, after reviewing this GPL our lawyers advised us that any products compiled with GPL'ed tools - such as gcc - would also have to its source code released. This was simply unacceptable.

    Although we had planned for no one outside of this company to ever use, let alone see the source code, we were now put in a difficult position. We could either give away our hard work, or come up with another solution. Although it was tought to do, there really was no option: We had to rewrite the code, from scratch, for Windows 2000.

    I think the biggest thing keeping Linux from being truly competitive with Microsoft is this GPL. Its draconian requirements virtually guarentee that no business will ever be able to use it. After my experience with Linux, I won't be recommending it to any of my associates. I may reconsider if Linux switches its license to something a little more fair, such as Microsoft's "Shared Source".

    Until then its attempts to socialize the software market will insure it remains only a bit player.

    Thank you for your time.

    1. Re:The GPL: Protection or Theft? by Pete · · Score: 1
      Our friendly little AC scrawled upon Slashdot with his crayons:
      Consulting for several large companies,
      ...with no names...
      Recently however, a top online investment firm asked us to do some work
      ...about which you give not the slightest detail...
      using Linux. The concept of having access to source code was very appealing to us, as we'd be able to modify the kernel to meet our exacting standards
      ...about which you give not the slightest detail...
      which we're unable to do with Microsoft's products.
      Gotcha. You'd be able to modify the kernel which you're unable to do with Microsoft's products. Noted.
      Although we met several technical challenges along the way (specifically, Linux's lack of Token Ring support and the fact that we were unable to defrag its ext2 file system),
      You've been trying very hard so far, but this is the most obvious troll pointer - unless your "company" you must have just not noticed this and this.
      So you can imagine our suprise when we were informed by a lawyer
      ...with no name...
      Part of this license states that any changes to the kernel are to be made freely available.
      The GPL specifically mentions the Linux kernel (only one of thousands of projects licensed under the GPL), does it?
      Unfortunately for us, this meant that the great deal of time and money we spent "touching up" Linux
      ...to meet your "exacting" standards, yes... (sorry, having difficulty keeping the face straight here... :-)
      to work for this investment firm would now be available at no cost to our competitors.
      Bugger, eh?
      Furthermore, after reviewing this GPL our lawyers
      ...who still don't have names...
      advised us that any products compiled with GPL'ed tools - such as gcc - would also have to its source code released. This was simply unacceptable.
      I've also been told by special voices (that only I can hear) that because the US President's name starts with "G", the world is doomed to nuclear annihilation sometime next week. This is simply unacceptable to me. He needs to change his name, and fast.
      Although we had planned for no one outside of this company
      Hell, preferably noone inside the company either, I'd hope!
      to ever use,
      I mean, you don't want people using your product, do you? Shit, were would be be if we had that situation? Just imagine what the world would be like if software producers had people using the software they create...
      let alone see the source code, we were now put in a difficult position. We could either give away our hard work, or come up with another solution.
      "...We tried contacting the Good Software Group to help us out with our difficult position, but they haven't returned any of our phone calls yet."
      Although it was tought to do, there really was no option: We had to rewrite the code, from scratch, for Windows 2000.
      Despite the fact that you were unable to modify the Windows 2000 kernel to meet your exacting standards, as you previously mentioned...
      I think
      ...despite overwhelming evidence to the contrary...
      the biggest thing keeping Linux from being truly competitive with Microsoft is this GPL.
      Not Microsoft's army of evil monkeys? Wow.
      Its draconian requirements virtually guarentee that no business will ever be able to use it.
      No doubt it virtually does - in your virtual world - just like it has with your virtual company and virtual lawyers and virtual clients like the aforementioned virtual investment firm.
      After my experience with Linux,
      "...an experience strangely akin to the last twenty minutes of 2001: A Space Odyssey, if I remember correctly, which I don't..."
      I won't be recommending it to any of my
      ...virtual...
      associates. I may reconsider if Linux switches its license to something a little more fair, such as Microsoft's "Shared Source".
      Whoopee.
      Until then its attempts to socialize the software market will insure it remains only a bit player.
      "THAT WAS A PUNE, OR PLAY ON WORDS, ALBERT. I DON'T KNOW IF YOU NOTICED." "I'm laughing like hell deep down, sir." "HO. HO. HO." -- Terry Pratchett, "Hogfather".
      Thank you for your time.
      No problem.
      Pete.
      PS. Sigh.
  71. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2

    There is an argument that drivers would drive much more safely if there was a sharp point sticking out of the steering wheel. Any accident and you would die. The drivers will be really attentive. However to ensure the safety, the drivers are going to have to slow down... In the software world this transfers to less code written.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  72. EDG's role by Animats · · Score: 4, Informative
    As others have mentioned, Edison only does the front end. The output is an intermediate form, not object code. There aren't very many C++ parsers. GCC has one, Microsoft has one, and most of the other compilers use the EDG front end.

    It says something about how complex C++ syntax has become that this is the case. It's very hard to parse C++, because you have to do extensive declaration handling to find out what's a type name, and you have to know what's a type name just to parse. C++ is thus context-dependent.

    One major implication of that context-dependency is that you can't parse a C++ text file without processing the include files. This is why tools like "indent" are hard to find for C++. "Little" tools for C++ are rare. And that hurts the language.

    I'd like to see a cleanup of C++, but it's not going to happen. Most of the action in the C++ standards effort is going into adding obscure features for fancy templates. As a result, C# and Java are gaining market share.

    1. Re:EDG's role by Daveed_V · · Score: 1

      The front end is certainly the biggest part of our C++ product. It generates an intermerdiate representation that gives you all the info about a C++ (or C) program. We also provide a module that "lowers" the C++-specific constructs to C-equivalent constructs (though you can opt not to lower e.g. exception handling). Two other modules generate C or C++ from the intermediate representation; we can them the C-generating and C++-generating back ends. (The ability to generate C++ is used by various source-to-source tool vendors.)

    2. Re:EDG's role by Matthew+Austern · · Score: 1
      There aren't very many C++ parsers. GCC has one, Microsoft has one, and most of the other compilers use the EDG front end.

      That's an exaggeration. EDG's front end is widely used (as it ought to be, because it's very good), but there are lots of companies with non-EDG compilers out there. To name a few: Metrowerks, IBM, Sun, HP, Borland.

    3. Re:EDG's role by Anonymous Coward · · Score: 0

      There are more older C++ frontends around too. Older means
      that they are not as standard compliant as the big guys (often especially in templates and other obscure features), but implement a significant and usable subset of C++.
      Examples are OpenC++ (free), TenDRA C++ (free), Watcom C++ (hopefully soon to be free),
      and variants in various lints.

      -Someone who thinks the biggest mistake the C++ comittee did was to add Turing complete templates.

    4. Re:EDG's role by JKR · · Score: 1
      C++ is thus context-dependent

      Er, isn't that because C is context-dependent? - I can't remember which language syntantical structure is responsible, but you can't write an LALR parser for C without resorting to a bit of trickery.

    5. Re:EDG's role by pdh11 · · Score: 2, Interesting
      I can't remember which language syntantical structure is responsible, but you can't write an LALR parser for C without resorting to a bit of trickery.

      foo = (bar)-7;

      You can't tell if that's a cast of a negative integer to type "bar" or a subtraction of 7 from variable "bar" unless you know whether "bar" is a typedef name or not.

      But C++ has significantly worse parsing problems.

      Peter

  73. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    I said most of the time , even within one program designers rarely need maximum speed at every point. My point is that the defaults of the language are almost uniformly dangerous.

    This claim has no factual basis.

    What? No? As in none at all? Lack of a garbage collector? No array bounds checking? No constraints on pointer arithmetic? Automatic type casts usually with no compiler warnings?

    C++ was not designed from scratch, it was constrained

    I prefer the word 'damaged'

    by C compatibility. For the most part, this is the reason. Basically, getting rid of "sharp bits" wasn't the primary goal of the language.

    You mean it's an eyesore, but because we know why, that's ok then?

    Look I've lived at the sharp end of the language more than most. I've worked on multi-million lines of embedded, persistent, realtime code much of it in C++, and without the benefit of the STL. Trust me when I say C++ has some major issues. I've also sometimes had to maintain less clueful peoples code... all I can say is: yuck.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  74. More Importantly by LPetrazickis · · Score: 1

    More importantly, they misspelled "vapour" as "vapor".;)

    --
    Is this a sigs-optional kind of place? 'Cause I am totally down with that if you know what I mean.
    1. Re:More Importantly by Anonymous Coward · · Score: 0

      well, it's not like you can blame them, linux doesn't have a integrated spell checker, or intergrated anything for that matter.

    2. Re:More Importantly by c00lant · · Score: 0

      Vapor is also correct, in fact its the actual term. Brits just stick those damn "u"s after the "o" to seem snooty and important

    3. Re:More Importantly by smittyoneeach · · Score: 1

      We owe this to Noah Webster, I'm told, an example of someone in the right place at the right time using their power (in this case, publishing a dictionary) in an arbitrary way that triggers endless pettifoggery.
      The good news is that this is merely English. In the IT case, we have similar wrongheaded undertakings from Mr. Somebody that cost folks a lot of money.
      Stroustrup will be similarly vilified regardless of what he does with the Standard; you'd think that a merger/cleanup with C would be a Good Thing, but listen to the howls drifting back in time from that possible future...

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    4. Re:More Importantly by Anonymous Coward · · Score: 0

      He was mostly right. Traditional English spelling was far too elaborate and misleading (it still is, but less so in the US). If you don't say "vay-poo-er" you shouldn't be writing "vapour".

    5. Re:More Importantly by jcast · · Score: 1

      Stop being so Euro-centric :)

      --
      There are reasons why democracy does not work nearly as well as capitalism.
      -- David D. Friedman
    6. Re:More Importantly by (outer-limits) · · Score: 1

      Apparently that is exactly where many of the useless spelling changes came from, such as using 's' for 'z'. Upper Class English thought it was cool to bastaradise the spelling to appear to be even more upper class.

      --

      Microsoft - Where would you like to go today, Maybe Jail?

  75. Do you need VB to troll? by theolein · · Score: 2

    I can't belive posts like this one where an MS troll actually thinks that someone is going to believe things like "GCC is obscured from us by the marketing people at the FSF" or "Java's source seems to be under the monopolistic thumb of Sun" and "Microsoft's "shared source" under which Visual Basic is released definately seems to be the most fair and reasonable of all the licenses in existance" and "harsh restrictions of the BSD license".

    I get so flabbergasted that I'm actually speechless when I see some say that the BSD licence is harsh. Or that GCC is obscured. Not only this but you have the sources of Java in every JDK downlowd and this troll actually thinks that the world is going to suddenly switch to VB??? And he hasn't actually ever coded in C++?? Has he coded at all I ask myself, because it seems he's actually better at repeating Microsoft press propaganda statements than anything else.

    1. Re:Do you need VB to troll? by Anonymous Coward · · Score: 0

      he's probably pretending to be a pathetic idiot troll to troll trolls. unfortunately not doing too well though..

  76. Hmm they have same disease as HURD and Stallman by linuxislandsucks · · Score: 1

    Hmm same disease as HURD and stallman..

    Okay whats next in 2012? It will compile COBOL?

    --
    Don't Tread on OpenSource
  77. ObjC by theolein · · Score: 3, Interesting

    I am not in any way a C++ programmer. The only thing I've ever read my way through is the Bruce Eckel's book. That was enough for me. I know some Java and C and was starting to learn how to go further on Mac OSX (which uses GCC) and was wondering whether to go with C++ or ObjC. One little trial programme in both and I went with ObjC. It *is* a lot easier, especially if you know some Java and has similar dynamic features. I don't know enough to comment on whther C++ is faster or not but it defintely has a very difficult syntax for beginners.

    Although I agree with the OSS crowd that Java should also be opensourced, it is at least a standard and this is a godsend for someone learning the language. In C++ the problem with learning it is whose version do you learn? Microsoft's? GCC? What are the fine points of symantic differences inbetween the differing versions? ObjC has this problem as well but since it's only heavily used on OSx at the moment it is not so critical, but if GNUStep were to more successful for instance there might arise differnces there as well (infighting over GCC ObjC compilation with Apple etc). I personally wish for more standards in these heavily used languages although I don't suppose it'll happen anytime soon.

  78. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    >>>I said most of the time , even within one program designers rarely need maximum speed at every point.
    >>My point is that the defaults of the language are almost uniformly dangerous.

    >>This claim has no factual basis.

    >What? No? As in none at all?

    You said the defaults of the language are uniformly dangerous. A single example, or even multiple examples of dangerous aspects of the language does not support this claim, because (a) you'd need to show that these dangerous facets are "default" in some sense, and (b) you'd need to argue this for everything that's a "default" (whatever that means).

    Lack of a garbage collector?

    That's not a "default". It's a feature that the language doesn't have. It doesn't in any way support the "uniformly dangerous" hyperbole above.

    No array bounds checking?

    See std::vector. Use bounds checking if you like. In some applications (matrix arithmatic), I've found that bounds checking results in a 50% performance hit, so I'm glad that the language doesn't nanny me.

    No constraints on pointer arithmetic?

    Pointer arithmatic is not "a default". It's actually something you shouldn't need very often.

    Automatic type casts usually with no compiler warnings?

    Well, learn to use your compiler, and turn the warnings on.

    I prefer the word 'damaged'

    Use whatever word you like, but there are very good reasons for making the language C compatible. C compatibility is a two edged sword. On one hand, you inherit messy syntax and dangerous code. On the other hand, you also have compatibility with existing software systems, and a language framework suitable for developing high performance software.

    You mean it's an eyesore, but because we know why, that's ok then?

    No, it's an eyesore, because it makes tradeoffs. The tradeoffs (elegance/performance and compatibility) might not be "pretty", but purity and beauty are not design goals of C++. Solving real world problems is.

    Look I've lived at the sharp end of the language more than most. I've worked on multi-million lines of embedded, persistent, realtime code much of it in C++, and without the benefit of the STL. Trust me when I say C++ has some major issues

    So, why didn't they use java or smalltalk or LISP for that embedded, persistent, realtime code ??? I think you know the answer-- those languages make tradeoffs that make them more or less useless for embedded or realtime applications. On the other hand, the tradeoffs that C++ makes -- namely, tradeoffs in favor of compatibility and performance -- have a lot to do with the fact that you are using it for these things.

  79. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    >>My point is that the defaults of the language are almost uniformly dangerous.

    >>This claim has no factual basis.

    >What? No? As in none at all?

    You said the defaults of the language are uniformly dangerous.

    No I equivocated. I said almost. And I stand by it.

    So, why didn't they use java or smalltalk or LISP for that embedded, persistent, realtime code ??? I think you know the answer--

    Yes, I know the answer ;-)

    those languages make tradeoffs that make them more or less useless for embedded or realtime applications.

    Bzzzzt. You lose. Actually we've redesigned it to be a mixture of Java and C, and ditched C++ entirely... The submillisecond hard realtime stuff is C, and Java is perfectly fine for soft realtime, and embedded. I understand that LISP or Smalltalk have been successfully used in similar situations as well.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  80. Pardon me for saying this.... by thumperward · · Score: 1

    but isn't the entire, entire point of trolling to get a reaction like that?

    Wow, this is my first post in at least three months! We really need more digital video compression and / or Sealand threads on here I think.

    - Chris

  81. Re: We need an engineer who knows the whole langua by elflord · · Score: 1
    No I equivocated. I said almost. And I stand by it.

    > In that form, it is indeed a very weak and equivocal statement indeed, but judging by your snippage of my response, it's one that you're having a hard time supporting.

    Bzzzzt. You lose. Actually we've redesigned it to be a mixture of Java and C, and ditched C++ entirely...

    Hardly surprising-- from what you've said about your C++ usage (no STL, always using low level unsafe features), one gets the impression that you were never using C++ in the first place (compiling C with a C++ compiler doesn't count).

    As usual, you're dodging the question here. Java isn't used for the realtime stuff, because you can't implement real time software when you have non-deterministic garbage collection. As for "perfectly fine for soft realtime, and embedded", soft realtime doesn't mean a whole lot, and "embedded" covers a broad spectrum of things. Java works fine on the Zaurus, but the fact remains that C++ is less of a resource pig.

  82. Despair There's No OpenSource Parser (Not GCC) by Anonymous Coward · · Score: 0

    I want to write programs about my C++ programs. I can't get the info I want from GCC, the free ones I found suck, and it's really really hard to write my own. Why can't these EDG folks let me use their software for free? Why isn't there a reference C++ implementation? Why is C++ so damn hard to parse?

    Does anyone know a good way to get complete metatdata out of C++? Ideally it'd be complete enough to rewrite the source code, but I'd even settle for as much info as Java provides.

  83. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    one gets the impression that you were never using C++ in the first place (compiling C with a C++ compiler doesn't count).

    Gee do you think? Perhaps you'd do that. We didn't. We were/are actually using classes extensively, some people (I count myself in this, I have been OO'd for more than a decade) actually know how to write them. We didn't do any compiling C with the C++ compiler either; we had two compilers that interworked fine.

    Java isn't used for the realtime stuff, because you can't implement real time software when you have non-deterministic garbage collection.

    Actually, we aren't doing this, but IRC; garbage collection issues can be avoided in Java. If you allocate memory ahead of time you can avoid triggering the garbage collector entirely. We were actually having to do the same thing in C to avoid fragmentation. Most of our soft realtime has response times of upto 2 seconds. Hard realtime is down to about a millisecond and has deadlines you have to meet.

    Anyway modern incremental garbage collectors run plenty fast enough for soft realtime...

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  84. Baby's birthday by Graymalkin · · Score: 2

    June's DDJ (#337) has a pretty good article in it about C++ conformance and actually goes on to test a series of compilers for standards compliance. Pick up the magazine and read the article which was pretty interesting because they used Python to write a test framework that could be used with different compilers and different operating systems. They tested compilers on Solaris, Linux, and Windows2000. GCC 3.04 ended up with the highest passing percentage while VC++ ended up with the worst. They didn't include either the DDJ compiler or Intel's which was one I was especially curious about considering I just got a demo of it.

    --
    I'm a loner Dottie, a Rebel.
    1. Re:Baby's birthday by JKR · · Score: 2, Interesting
      GCC 3.04 ended up with the highest passing percentage while VC++ ended up with the worst.

      Care to elaborate which VERSION of VC++ they tested? I don't get DDJ, and if they're still banging on VC6 that's not very interesting. If MS haven't fixed the conformance problems in VC++.NET it'd be handy to know.

  85. Re: We need an engineer who knows the whole langua by elflord · · Score: 1
    Gee do you think? Perhaps you'd do that. We didn't. We were/are actually using classes extensively, some people (I count myself in this, I have been OO'd for more than a decade) actually know how to write them.

    Yet, you didn't use STL, and were constantly forced to use unsafe pointer manipulations ? I don't really follow most of the complaints you made about C++: you talk about unsafe switch statements, no bounds checking, and dangerous pointer arithmatic. But all this can be addressed by using object oriented code and STL.

    Actually, we aren't doing this, but IRC; garbage collection issues can be avoided in Java. If you allocate memory ahead of time you can avoid triggering the garbage collector entirely.

    (-; If you allocate memory ahead of time in C++, most of these "safety" issues that you complain about can also be avoided. This can be done by providing allocators to STL containers and/or overloading operator new.

  86. You know what's funny? by newerbob · · Score: 0, Offtopic
    You know what cracks me up?

    Just about 4 years ago, people like Patrick Naughton were telling me that I'm wasting my time with C++, and that Java would replace everything. (I heard that story before, 20 years earlier, with UCSD Pascal!).

    Today, of course, C++ is the only choice for many real-world applications, and Patrick Naughton, Sun's Java Guru, is on the "Megan's Law" list as a convicted and admitted child raper

    Now that's funny!

    Use C++ because Java is for Child-Rapers

    --

    --
    Ask the Ya-Hoot Oracle Anything!
    1. Re:You know what's funny? by MrOrn · · Score: 1

      Wow! What an effective argument you put up.

      "If you use Java, you are a child raper."

      Slight problems with your "argument": firstly, you commit a logical fallacy - argumentum ad hominem. Simply because Java is supported or advocated by someone who was (I would say wrongly) convicted does not make Java a bad language. It says nothing about Java at all in fact. The fact that you have committed a logical fallacy means that your conclusion is spurious. (As if common sense doesn't already!)

      Secondly, Naughton, whatever his crime was, was convicted by entrapment. He did not actually rape anyone, nor did he have sex with anyone. He was entrapped into meeting an FBI agent who was posing as an underage girl, as the story you linked to makes pretty plain. Next time you want to illustrate a point, it might be useful to link to a story that actually supports your argument.

      Oh, and by the way, I'm a C++ programmer, which says nothing about my sexual habits. Or maybe I didn't read the EULA that came with my compiler that has a clause: "In agreeing to use this software, you confirm that you are not a child rapist." Maybe I also missed the lecture at uni where the professor made us swear that we were not child rapists before we learned C++?

    2. Re:You know what's funny? by Anonymous Coward · · Score: 1, Funny

      >>Oh, and by the way, I'm a C++ programmer....maybe I didn't read the EULA that came with my compiler that has a clause: "In agreeing to use this software, you confirm that you are not a child rapist."

      So you are a child raper then?

      Good to know: child rapers can use C++ everybody! Ask MrOrn; he is absolutely sure of this!

    3. Re:You know what's funny? by Anonymous Coward · · Score: 0
      hit a raw nerve, he did!

      Perhaps sir your name is missing an 'o' and has an extra r at the end? I believe his child rapist comment was a joke.

    4. Re:You know what's funny? by newerbob · · Score: 1
      Wait a minute.

      You mean you support what Patrick Naughton did?

      --

      --
      Ask the Ya-Hoot Oracle Anything!
    5. Re:You know what's funny? by cduffy · · Score: 1

      What did Patrick Naughton do?

      If he didn't rape anyone, or even have consensual sex with anyone, I don't see what your (or anyone else's) problem is -- and I certainly don't see how it has anything to do with him professionally.

  87. 8-bit int? by Anonymous Coward · · Score: 0

    i always thought that char = short = int = long where short takes at least 16 bits and long at least 32. but possibly even this isn't engraved on stone..

    1. Re:8-bit int? by Anonymous Coward · · Score: 0
      Yes, it's guaranteed that integer types are implemented in binary (though *_MIN is never low enough to rule out one's complement rather than two's), and that char, short, int, and long have at least 8, 16, 16, and 32 bits of precision (respectively), and that int is large enough to span the range of any array.

      Unfortunately it's no longer guaranteed that long is the largest integer type (due to whining from vendors who wanted abominations like 32-bit long on a 64-bit machine), for which I think everyone responsible deserved a beating.

  88. use the preview button by Anonymous Coward · · Score: 0

    = should be <=

  89. Yawn! by McDoobie · · Score: 3, Interesting

    Ada95 has had fully compliant compilers(plural) since at least 1995.(When it was Internationally standardized.)

    Java has at least a coherent standard. And Common Lisp has been there for almost 20 years now.

    It's funny to watch the members of the C/C++ Gestapo wet thier pants over this. I bet Bjorne is doing a double-take right about now.

  90. well, duh by Anonymous Coward · · Score: 0

    the first thing my programs do is to mmap the zero page for that very reason.

  91. Need g++ source? by mec · · Score: 1

    ... much the way that GCC is obscured from us by the marketing people at the FSF.

    Dude, no problem. Post your e-mail address and I'll send you a couple of different versions of gcc source.

    Plus I know this dude who promised to get me a 0-day rip of gcc 3.1 when it comes out if I pay him some $$$ ... wanna go in on it with me?

  92. The unbearable lightness of trolling by alienmole · · Score: 1
    Unless you have been living in a cave you will know that Google bought the usenet and renamed it to google groups.
    Uhm. Here, I must disagree with you. [trollee response snipped]
    I bet you are the life of the parties huh? The problem on /. is that the saying:
    "Never attribute to malice that which can be explained by mere incompetence"
    is turned on its head:
    "Never attribute to incompetence that which can be explained by ironic/trollish humor"
    It's the perfect trap for literal-minded nerds, hence the popularity of trolling on /. Like shooting fish in a barrel, it's not much of a challenge, but you get a lot of fish!
    1. Re:The unbearable lightness of trolling by sethdelackner · · Score: 1

      It's the perfect trap for literal-minded nerds, hence the popularity of trolling

      I just feel so sorry for the ones that get caught in the literal traps. When I see them, all I can think is aspergers.

  93. Re: We need an engineer who knows the whole langua by adamsc · · Score: 2

    It really gets down to time management: would those programmers take the time saved by using a less-primitive language and use it to fix the design problems behind those slow programs or add a bunch of pointless crap?

    I think the latter is more likely, no matter how much we might wish otherwise. Almost all of the slow programs we use are slow because of dumb code (from simple implementation gaffs up to complete architectural clusterfucks) and that's a language independent "skill".

  94. It's called a /joke/, man... by cduffy · · Score: 1

    ...and unlike your run-of-the-mill troll, it actually contains some partial truths and isn't intended to be taken seriounly by anyone.

    Now, if some people are idiots and take the post at face value... well, that's their problem. But a troll it ain't.

  95. Beware of Comeau by Anonymous Coward · · Score: 0

    from Comeau's site

    "Although not a C or C++ feature, Comeau C/C++ does not generate multi-threading aware code, although you can surely write code or use functions/classes that implement such things."

    Dont bother trying to use Comeau if your intending to do multi threaded stuff, my last company wasted 2-3 months of work converting the code to work in Comeau only to find that none of the threading stuff worked (that notice wasnt on the site at the time, its since appeard after we started shouting at them)

    other than that its a good compiler shame its not of much use to anyone who wants to do any serious code (server apps etc)

  96. Praise the mcse boot camp education by Billly+Gates · · Score: 1

    The sad thing is that this sort of sarcasim is beyond %90 of mcse's comprehension.

    1. Re:Praise the mcse boot camp education by jcast · · Score: 1
      --
      There are reasons why democracy does not work nearly as well as capitalism.
      -- David D. Friedman
  97. Re: We need an engineer who knows the whole langua by tijsvd · · Score: 1
    Hell, given gnome and kde, developers these days can't write acceptably fast software even in C/C++ (even on my 1.5GHz Athlon XP, KDE 3.x and GNOME 1.4 are pushing the limits of 'acceptable')

    It has more to do with the effiency of the code than the language, IMHO. For example, I opened a zip-file containing 3000+ files in ark and it took about 10 minutes to display the complete index! While just unzip -v takes less than 5 seconds.

    I looked at the source for ark and discovered that the contents are retrieved by spawning zip and then parsing the output using regular expressions! Of course that takes forever. If they would just have used a zip library, display could be much faster.

    The source contains even a comment like "could just as well parse output of unzip command"! Of course it's going to be slow that way.

  98. yet about Sun and Java by Anonymous Coward · · Score: 0

    I have always found it amusing that Sun continues to get away with the very same crap that MS has done. The only difference in Sun and MS is that MS was more sucessful at its raping.

  99. Java and Pointers by Anonymous Coward · · Score: 0
    with the disclosure that I am not a regular Java developer... I laughed when a long time Java developer who admitted he had a secret crush on C++, said "Java with each new release and proposed release (projected changes) seems to come closer and closer to C++. Soon I fully expect 'the C++ language without pointers' to implement pointers itself."

    He commented that this is in itself not a bad thing, but that there damn well better be the ability to have full functionality without ever using pointers... simply having the 'ability' but not the requirement to use them just adds to the tweaking ability of programs while cutting back on much of the complexity.

    Seriously though, I have talked to many that say that the reason Java seems to be evolving into a C++ clone is that C++ is the way to do it, were its problems fixed. Consider C++ the old Prototype or proof of concept: we have proven what and how things can be done, we must not refine it and get it right. Java had the possibility to do this, if it were not for stupidity and politics that are resulting in the very same mistakes. C# has a great possibility technically, but again you have the politics, ego and greed that could screw everything up. What I want for christmas is the dream of a language that simply produces complete objective binaries that can be called from any compatable (there's the problem) language efficiently (not this horrible lookup mess and indexing crap) and that I can embed and integrate scripting languages like Python, Lisp and even more web centric ones like Perl and PHP without a giant amount of overhead. These languages should ONLY be the human interface to the computer code and so should produce binary data that is usable by anything.

  100. The Google Thread by Taco+Cowboy · · Score: 2



    I know it's kinda off-topic, but I need to know how you guys get that "google thread" thing.

    Whenever I search the groups.google.com, even under the "thread mode", I get something like

    http://groups.google.com/groups?hl=en&threadm=52f2 f9cd.0205100428.7eecbcb6%40posting.google.com&rnum =1&prev=/groups%3Fas_epq%3Dfirst%2520fully%2520%25 20iso/ansi%2520compliant%26num%3D100%26hl%3Den

    instead of

    http://groups.google.com/groups?hl=en&th=e653fbdb7 85c5339&rnum=1

    So what has I done wrong ?

    --
    Muchas Gracias, Señor Edward Snowden !
  101. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    Yet, you didn't use STL, and were constantly forced to use unsafe pointer manipulations ?

    Where did I say that?

    But all this can be addressed by using object oriented code and STL.

    Well, I certainly don't agree that switch statements disappear in sensibly written OO code, in fact absence of them is a sign of an inexperienced designer. Using polymorphism for that impacts both readability and speed, and implies a use of inheritance that is quite detrimental. Nearly all new OO designers misuse inheritance.

    If you allocate memory ahead of time in C++, most of these "safety" issues that you complain about can also be avoided.

    What colour is the sky in your world?

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  102. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    In that form, it is indeed a very weak and equivocal statement indeed, but judging by your snippage of my response, it's one that you're having a hard time supporting.

    No, its very easy to support. You or I can write an entire book on the very obvious failings of C/C++ syntax. But, quite frankly I just can't be bothered here. You show no signs of being experienced enough with C++ and other languages to begin to appreciate it; plus in a few months all of these posting will be deleted. Only when you've learnt 20 or 30 computer languages and used atleast 10 in anger does it become clear just want went wrong- and what didn't (there's lots of good things about C/C++ too.)

    Oh, ok, one more unbelieveably trivial example. Consider 'int'. What size is it? Yeah I know, its undefined 'for performance reasons'. WTF? What this really means is that a very significant fraction of programs are non portable; sure they might work, but as the size of the program grows, the probability approaches zero. If they had defined 'int' to be 32 bits, and created a different type, say 'nativeint', then only if you really need the performance would you use it. If you understand enough to know you want performance you use it. If you don't understand enough- I don't want people who don't understand what they are doing using 'int'. The standard language defaults are almost uniformly unnecessarily dangerous... and yes theres that equivocation again.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  103. Rumors? by sharkey · · Score: 1
    There are rumors they can compile the Linux kernel too.

    Hell, I can do it too. Pretty simple, actually:
    • make bzImage
    You can do it, too!
    --

    --
    "Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
  104. Nope. by Anonymous Coward · · Score: 0

    Parent was not a joke. The kernel uses a lot of gcc extensions.

  105. Re: We need an engineer who knows the whole langua by cduffy · · Score: 2

    If it's cheaper to buy a new server or ten than to write the program in a lower-level language and have twice the debugging time and greater risk of security concerns due to buffer overflows and such, then writing the code in a high-level language is the Right Thing to do. If you're writing something that needs every bit of speed available, and the hardware that would be needed to get the same performance in a higher-level language costs more than would be saved by the difference in your time... okay, have fun with your low-level language. Usually when I find myself in a situation like that, I know it's time to raise my rates.

    That said -- a good civil engineer's techniques involve restrictions at their core. Every set of "well, we can do this..." incorporates hundreds of "but never do this, or that; and be sure that this load never exceeds that; and check for so-and-so". A good civil engineer's techniques are indeed self-limiting -- because only by playing within carefully defined limits can one be certain about the safety of the resulting structure. One of the things I agree with regarding software engineering is that far more dicipline is required in the field. Some of this has to be human dicipline -- there's no way around it -- but having tools that make it harder to make mistakes is a Good Thing too. Imagine trying to build chips without design checkers because the EEs should do all that work themselves -- it'd never fly at Intel.

  106. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    You show no signs of being experienced enough with C++ and other languages to begin to appreciate it;

    Arrogance is not victory (-;

    Oh, ok, one more unbelieveably trivial example. Consider 'int'. What size is it? Yeah I know, its undefined 'for performance reasons'. WTF?

    No, it's undefined because it's undefined in C. Compatibility with C is a big design tradeoff-- and it's largely responsible for most of the sharp edges in C++, but it's also the main reason that C++ has enjoyed such widespread adoption.

  107. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    Where did I say that?

    Read up a few posts...

    ...code much of it in C++, and without the benefit of the STL.

    Re bounds checking, and unsafe pointer manipulations, these were among your citations of "dangerous defaults".

    Well, I certainly don't agree that switch statements disappear in sensibly written OO code, in fact absence of them is a sign of an inexperienced designer.

    A switch statement can usually be replaced by a table lookup or polymorphism. As you rightly point out, sometimes switch statements are useful-- another good reason to keep them in the language, huh ? (-;

    Using polymorphism for that impacts both readability and speed,

    Sometimes a table lookup is more appropriate than polymorphism, it's a little less opaque. A switch is essentially a sort of inlined table dispatch, so the only reason I see for using it is performance or convenience.

    What colour is the sky in your world?

  108. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    If it's cheaper to buy a new server or ten than to write the program in a lower-level language and have twice the debugging time and greater risk of security concerns due to buffer overflows and such, then writing the code in a high-level language is the Right Thing to do.

    First, you're assuming that buffer overruns are the only possible error. This is simply wrong. Programs that do not have the benefit of static checking are prone to all sorts of wierd bugs, which ultimately can become security flaws. Apart from anything else, the assumption that C++ code always results in buffer overruns is just bogus. It's very hard to end up with buffer overruns if you stick to safe STL containers.

    That said -- a good civil engineer's techniques involve restrictions at their core. Every set of "well, we can do this..." incorporates hundreds of "but never do this, or that; and be sure that this load never exceeds that; and check for so-and-so".

    Yep. A professionals tools require some discipline to use.

  109. Re: We need an engineer who knows the whole langua by cduffy · · Score: 2

    First, you're assuming that buffer overruns are the only possible error.

    Of course not. I didn't even say safe languages would fix even most security issues, only that the failure to use one would result in a "greater" risk of security concerns. Stop putting words in my mouth. I agree that static checking is extremely important. I do not see how use of STL containers are likely to be useful in fighting buffer overflow vulnerabilities -- most of the vulnerabilities I've seen have been inside boundary code (network or file I/O, parsing routines, &c) where the internal data storage mechanisms used after processing aren't particularly relevant.

    A professional's tools require some dicipline to use.

    Absolutely! But this dicipline is not strictly on the part of the user. When I buy a hammer, I don't expect to have a 3-part procedure I have to follow to prevent the head from flying off -- the tool should just Do The Right Thing, even if it means I don't get the benefits of a detachable hammer head usable as a counterweight. That is to say, the hammer should follow the Principle of Least Surprise. A good programming language should do the same.

  110. Re:sean23007's IQ: 10? or less. I say less. by sean23007 · · Score: 1, Offtopic

    Four more things:

    1) What the hell do I care? Hemos' UID is even lower than yours, do get up and shout "Heil Hemos" every morning? I didn't think so.

    2) "Some large group of people really hates you." Actually, English is my first language, and I'm damn good at it. There is nothing wrong with that sentence, and it goes against your minimal intelligence that you were unable to fathom its simplicity. Try going through it a couple more times, someday you'll get it. Perhaps.

    3) What comments? Hey, just be glad it isn't "Post-Columbine Spider-Man in a Globalist Techno Geek World" so turn off the lights 'cause it's night on the sun +3 for spamming? Hmm... maybe I can pick up some extra karma too: Increase your ejaculation 800% with Ejacu-spurt! All natural, all legal, all herbal! "the" event? Which event is that? You don't mention a specific event in the story. Imagine if Slashdot had something like 'editors' to correct stories before they were posted... damn... that'd almost be something worth paying for. Wil, do you sell pairs of used underwear, and if so, how much? You pedophiles disgust me. this fp brought to you buy the hardy boys... SuSe is gnome-only, and Mandrake can do KDE or Gnome or whatever. How the hell would those be rewarded with high moderation? I think you need to recheck your definition of "infinite." Or at least your definitions of "intelligent" and "informative." Your posts are none of these.

    4) Congratulations, you have managed to bring in the ultimate buzzword: September 11th! Oh hot damn, isn't this great? The son of a bitch named beee who started this little argument here is now accusing the articulate defendant of "tearing apart" the proverbial "us." O you, as shocked and outraged as you may be, are the party guilty of flinging four pieces of shit in my direction.

    --

    Lack of eloquence does not denote lack of intelligence, though they often coincide.
  111. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    No, it's undefined because it's undefined in C.

    So defining it for C++ would have made it incompatible? On reflection: No, I don't see that.

    But that wasn't the point. My point was that many, many features of the language are unnecessarily dangerous; even an int; you haven't really grokked this point.

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  112. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    Where did I say that?

    Read up a few posts...

    I never said that anywhere.

    As you rightly point out, sometimes switch statements are useful-- another good reason to keep them in the language, huh ? (-;

    Of course, I love switch statements, but the syntax is much more dangerous than it needs to be. If fact you don't actually need 'if' statements, just use switch ;-)

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  113. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    Stop putting words in my mouth.

    Oops ... I misunderstood you.

    I do not see how use of STL containers are likely to be useful in fighting buffer overflow vulnerabilities -- most of the vulnerabilities I've seen have been inside boundary code (network or file I/O, parsing routines, &c) where the internal data storage mechanisms used after processing aren't particularly relevant.

    In all of these cases, simply having containers that grow on demand deals with some of the issues, bounds checked access and using STL algorithms instead of loops deals with others. Basically, if you enumerate the things that can go wrong with respect to buffer overruns, I can enumerate a list of reasons why the STL containers address this.

  114. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    the tool should just Do The Right Thing, even if it means I don't get the benefits of a detachable hammer head usable as a counterweight. That is to say, the hammer should follow the Principle of Least Surprise. A good programming language should do the same.

    Doh! I forgot to respond to this. There are a lot of things a good programming language "should" do, and suffice it to say, no programming language does all of them. This is where tradeoffs come in. Unlike most other programming languages, there is a well reasoned exlpanation (in book form) explaining how and why C++ is designed the way it is, and what the rationale behind the tradeoffs is.

  115. Re: We need an engineer who knows the whole langua by elflord · · Score: 1
    I never said that anywhere.

    Yes you did

    Of course, I love switch statements, but the syntax is much more dangerous than it needs to be.

    What change of syntax do you propose, without breaking C compatibility ?

  116. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    So defining it for C++ would have made it incompatible? On reflection: No, I don't see that.

    For all practical intents and purposes, it would. Consider the implications of trying to reuse C libraries that declare functions that take arguments of type int, or data structures that aggregate ints.

    My point was that many, many features of the language are unnecessarily dangerous; even an int; you haven't really grokked this point.

    Most of the "dangerous" features of the language are a direct result of C compatibility. Compatibility has a lot of disadvantages, but it is dishonest to hype the disadvantages while belittling or ignoring the advantages.

  117. reading too much slashdot by GCP · · Score: 2

    It sucks that all these great technologies are being relegated to obscurity because of ...

    I was trying to figure out how to end that sentence, and all I could come up with was Microsoft and FUD. I've been reading too much Slashdot!


    Yes, you have. While it's true that MS can often save a language from obscurity (BASIC), it's hardly the only way, and making languages popular isn't MS's responsibility.

    Languages like Java, JavaScript, and Perl are extremely popular, yet they owe little to MS. MS pushed for J++, JScript, and ignored Perl almost entirely until very recently, but that didn't matter much.

    What it takes for a language to become popular is some huge advantage -- being the best way to do something that suddenly booms in importance (Perl for CGI) or having billions of dollars of development put behind it (Java, which was also in the right place at the right time), or being an incremental successor that keeps adding goodies to the most popular language (C++ absorbing C developers) so other (better) languages can't easily lure them away.

    A language having some nice features is ... nice, but that's not enough.

    I agree with your frustration, though. I really wish that it could be possible for each of us to create his dream language and just use it wherever we go. Create a way for that to happen, and you'll have real popularity.

    --
    "Those who have never entered upon scientific pursuits know not a tithe of the poetry by which they are surrounded."
  118. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    Would it help if someone documented that most folks using counterweights also need hammers?

    Just because someone can write a book explaining their decisions (or because the tradeoffs involved in some design have a consistant rationale behind them) doesn't make the end product the Right Thing. A book could be written defending (say) Guido's design decisions in making Python, or defending the decisions behind R5RS. Neither of these facts makes Python or Scheme a more appropriate language for my hypothetical next project -- the only way to tell is by considering whether those tradeoffs are appropriate given the project in mind. That said, I run into more projects (far more projects!) for which Java or Python or Scheme is appropriate than C++; at least in my line of work, performance is rarely at a premium (usually -- when writing some code for testing embedded systems, the (very thin) client code ended up being best done in C, and the code running on the big beefy server found itself written mostly in Python). (FWIW, I've never had a project worth mentioning where Scheme was appropriate for the whole thing -- but sometimes some small component such as the test suite just screams for it).

    As for me, the proof is in the pudding -- I go from concept to finished, debugged product faster using safe languages than unsafe ones. Maybe you currently work better with C++ -- but unless your problem space is crying out for the language (ie. you have a huge amount of legacy code), I suspect you'd be at least as productive, and perhaps even happier, elsewhere.

  119. Re: We need an engineer who knows the whole langua by cduffy · · Score: 2

    In all of these cases, simply having containers that grow on demand deals with some of the issues, bounds checked access and using STL algorithms instead of loops deals with others. Basically, if you enumerate the things that can go wrong with respect to buffer overruns, I can enumerate a list of reasons why the STL containers address this.

    Then why do we still have buffer overruns, even in C++ code?

    Even accepting your premise that Doing The Right Thing in C++ avoids buffer overflows completely, Doing The Right Thing in C++ is hard, or at least nonobvious -- as evidenced by the beginners (and experienced programmers who lack familiarity with C++) who do the wrong thing.

    Should it be the programmer's duty to be sure they're doing the right thing? Of course! Is that any excuse for using tools that make it easy to do the wrong thing? Unless those tools have some other compelling advantage, absolutely not.

    So... show me the advantage!

    And lest you mention the flexibility involved in being able to do things either the C way or the C++ way or many hybrid ways between, I consider that a disadvantage, and a severe one at that -- redundancy in language design is a Very Bad Thing, as it means the language is not yet elegant; there's still more left to take away. A considered and defendable design decision? Certainly! The correct decision? No.

  120. Re: We need an engineer who knows the whole langua by WolfWithoutAClause · · Score: 2
    For all practical intents and purposes, it would. Consider the implications of trying to reuse C libraries that declare functions that take arguments of type int, or data structures that aggregate ints.

    Hey- you're actually right for once!

    --

    -WolfWithoutAClause

    "Gravity is only a theory, not a fact!"
  121. The C++ standards effort by Per+Abrahamsen · · Score: 2

    As far as I can see, almost all the effort towards a new C++ standard is on the the library side. C++ has an excellent container library (STL), an ok library for serial i/o (iostream), but lacks libraries for networking, threads, file system, etc.

    A bit of language cleanup is done, like getting rid of implicit int. However the major problem with regard to context sensitivity, the declaration syntax, is inherited from C and would be hard to remove.

  122. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    the only way to tell is by considering whether those tradeoffs are appropriate given the project in mind.

    I'd have to agree with this.

    That said, I run into more projects (far more projects!) for which Java or Python or Scheme is appropriate than C++; at least in my line of work, performance is rarely at a premium

    If you're saying these are "safe" languages, I'd have to beg to differ. Java has some static type safety, but unfortunately, the lack of generics (templates) greatly weakens this. Python is a very nice language, and the tradeoffs it makes are very sensible (in particular, it consistently prefers readability to writability). However, it doesn't make a whole lot of sense to compare it to C++. In my experience, Python does not compete with C++, it compliments it. That is, I use both C++ and python in the same project. As far as being "safe" is concerned, Python has no compile time type safety. It is well designed, and very useful, but I wouldn'y call it "safe".

  123. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    Then why do we still have buffer overruns, even in C++ code?

    Examples ? I never have buffer runs in my C++ code, so as far as choice of language for me is concerned, this is a non-issue. I suspect most such code probably predates STL.

    Doing The Right Thing in C++ is hard, or at least nonobvious -- as evidenced by the beginners (and experienced programmers who lack familiarity with C++) who do the wrong thing.

    No, it's not "hard" at all. There are beginners books, like Accelerated C++ that teach you to write code in a style that will prevent buffer overruns occurring.

    Of course! Is that any excuse for using tools that make it easy to do the wrong thing? Unless those tools have some other compelling advantage, absolutely not.

    C compatibility is a compelling advantage. It is the main reason that C++ enjoys its current level of popularity. As for "easy to do the wrong thing" ... I think you'd be hard pressed to find a language that doesn't make it easy to do the wrong thing in some form or other. For example, C++ is one of the few popular programming languages with sufficient type safety to prevent the programmer making type errors. Java, and interpreted languages all require a lot of runtime type checking (in Javas case, it's because the language lacks generics and uses a single rooted heirarchy instead)

    I consider that a disadvantage, and a severe one at that -- redundancy in language design is a Very Bad Thing, as it means the language is not yet elegant;

    Elegance is not one of the design goals of the C++ language. Largely because there is very little correlation between elegance (or purity or beauty) and usefulness in real-world projects.

  124. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    I agree -- Python is not "safe" in the sense that Java is, and it lacks the compile-time checking done with C and C++. Weird and interesting error states are possible, and making demonstrably reliable Python software absolutely and unquestionably requires a large and well-maintained test suite (as all the error checking is done at runtime). The same's pretty much true of Scheme -- yes, the variant I use has compile-time type checking, but that's very much an extension, and purely optional, and doesn't look inside structures (and is otherwise quite limited).

    So yes, it's a very different manner in which I use "safe" here -- it doesn't imply all-round reliable software, but just software where one particular (large!) class of problems is solved while others may exist. Suffice to say that I don't use Python or Scheme for code that needs to be reliable -- they find their way into surrounding stuff like the test suites or administration tools or are used in code built for internal use.

    As for the lack of templates, I just haven't found it to be a problem -- interfaces have served my purposes suitably there. YMMV, of course; if you absolutely need a generic function that works on classes you didn't write and can't subclass (but which still has all the compile-time checking needed), that could indeed make for a bad situation (where one's handling Objects and doing introspection-style calls). That said, a good test suite will generally find issues in that kind of code -- and any worthwhile project will (hopefully!) have one anyhow.

  125. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    A language can be useful without being elegant -- but an elegant language will be more readable, more easily learned, more maintainable, and more fun to write in. (Does "fun" matter? Hell, yes! Granted, I'll still get the job done regardless, but I do my best work when I'm enjoying it).

    The more extra stuff a language has upon that which is needed to be elegant, the more there is to learn; the more different "obvious" ways there are to implement the exact same thing (and so the more likely ways to run into bugs are available); the more individuals' particular coding styles affect the output; the more libraries one has to learn. Having a clean language helps in the production of clean code -- it's no panacia to be sure (I've seen horrid Python and beautiful Perl) but it's helpful. Like cleanliness of design, the importance of elegance should never be underestimated -- you can make something with a messy design work, but the clean design is the one that'll actually be able to keep up with your requirements over 10 years of part-timer skeleton-crew maintenance.

    For that matter, one can "know C++" without knowing STL, and be pretty much useless in fact. One can't "know Java" without knowing the Java runtime, and being conversant with its proper use.

    As for the particulars... well, I mention the lack of generics in the other thread; might as well keep it there.

  126. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    A language can be useful without being elegant -- but an elegant language will be more readable, more easily learned, more maintainable, and more fun to write in.

    All other things being equal, yes, of course. But in the real world, all other things aren't equal. The other languages have poor type safety, and in some cases, a lack of encapsulation. These factors also impact r maintainability (especially encapsulation!) But the more severe impact of not having type safety or encapsulation is that it severely hurts scalability, which is why C++ is still a popular choice for large projects.

    you can make something with a messy design work, but the clean design is the one that'll actually be able to keep up with your requirements over 10 years of part-timer skeleton-crew maintenance.

    That's why you want things like encapsulation and static checking. Clean design isn't that easy when every type of object looks like every other type, and there is no encapsulation.

  127. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    As for the lack of templates, I just haven't found it to be a problem -- interfaces have served my purposes suitably there.

    How do you write typesafe container classes without generics ? In the case of java, you don't -- you abuse the single-rooted object heirarchy instead. Java containers are no more typesafe than perl or python containers.

  128. Re: We need an engineer who knows the whole langua by cduffy · · Score: 2

    I wouldn't say "no more typesafe" -- at least in Java you'll always get runtime errors for casting that which you get out of your container into the wrong type. Thus, if your compilation process includes a "make test" or some equivalent, such errors will always be caught. In Perl or Python you're not even guaranteed those (unless you try some use of the object which isn't available in the mistakenly-passed type).

  129. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    I wouldn't say "no more typesafe" -- at least in Java you'll always get runtime errors for casting that which you get out of your container into the wrong type.

    Point taken-- this is a subtle but important distinction. The situation is still quite bad though, because the cause and effect of the error are separated by a wide margin -- that is, you could put an object of the wrong type into a container, and the problem wouldn't surface until you tried to access that element, which means that a simple backtrace (which java is kind enough to give you by default ... )

    All that said, I actually like java. Sort of like C++ without the nasty C-isms. The only thing preventing me from using it is performance issues. But I'd still like to see generics.

  130. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    No encapsulation?! One doesn't even need any language support to do encapsulation -- one can do encapsulation in C, or assembly for that matter; it's a matter of good design, rather than language features. That said, there's still language support for encapsulation in all those languages I mention. What do interfaces do in Java? Stub classes in Python? (ya know... base classes with functions left to inherited classes throwing "NotImplementedError")? Hell, I can do encapsulation in scheme, and we both know it's a language not well suited to that. And every type of object most certainly does not look like every other type in Java (maybe when you're taking them out of a container -- but the moment you put them into a variable or call something with them, the checking is enforced). If this were such a problem as you make it to be, one could (easily!) build a container class in Java that checks the types of objects put into it at runtime against a type passed in on its instanciation. (Heck, if it were a real-world problem, one would expect that Sun would have done it by now). Why don't I do it? Because IRL (at least if one does runtime testing... hence my emphasis on test suites!), the problem that addresses just doesn't come up, or at least doesn't result in latent bugs. If you need to write such a container class to take advantage of the other capabilities of Java, though, go ahead, and have fun. Making up objections because they seem like they'd be problems to you, however, makes you no better than those who can't see how Python's whitespace syntax could possibly be useful, though they've yet to try it.

    Take the runtime checking into account (and presuming you have an automatic test suite running after every compile -- which everyone should, no matter the language), Java is as "safe" (in that usage) as C++ -- and given the use of GC rather than manual memory management, enforced runtime bounds checking (even in code written by poor programmers) and the like, it's considerably more so.

    A good test suite will do more for reliability and maintainability than a little extra static checking ever will; presuming one to be in place either way, sacrificing the benefits of an elegant language for only that tiny bit of extra type checking is simply not The Right Thing.

  131. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    Making the containers check the types of added objects upon their addition isn't a particularly hard thing -- though it's unfortunate that it isn't already implemented in the container classes included in the Java runtime. That said, you'd have to have the wrong object be added somewhere where it's either a return value put directly into the collection without being put into a variable (and thus type-checked!), passed to any other function in your code (and thus type-checked!) or explicitly casted to what it Should Be (say, before the cast to Object), or where the type it's being checked against is fully wrong.

    If you've got a test suite that runs on every compile, of course, this is less of a problem -- if you just touched the code that adds an object to that collection at point *a* and the test suite starts failing, you know what's up even if point *b* is what the stack trace indicates. Granted, though, having proper compile-time checking on insert would be a much better thing. Doing it at runtime is probably not a bad idea, though it'd be unfortunate to have to provide your own container (sub)classes.

    Regarding speed, btw -- depends on what you're writing, of course, but have you tried particularly new Java runtimes? I've been doing servlets lately, and have been very pleasently surprised by the performance.

  132. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    One doesn't even need any language support to do encapsulation -- one can do encapsulation in C, or assembly for that matter; it's a matter of good design, rather than language features.

    A language can either facilitate encapsulation, or make it difficult. The whole argument against C++ in this thread has been that it's not idiot proof enough. So in this context, the fact that it may be possible to implement encapsulation via clever hacks is beside the point.

    That said, there's still language support for encapsulation in all those languages I mention.

    Python does not have any access protection on class members. Sure, you can write stub classes, but that requires more design, which eats away at this alleged "rapid development" advantage you're supposed to get from interpreted languages. And it doesn't alter the fact that you don't have private data. Java on the other hand has good data protection, arguably better than C++. Good C programmers can and do encapsulate, but then, good C++ programmers avoid the misfeatures of the language. C++ provides well-defined semantics for encapsulation.

    If this were such a problem as you make it to be, one could (easily!) build a container class in Java that checks the types of objects put into it at runtime against a type passed in on its instanciation. (Heck, if it were a real-world problem, one would expect that Sun would have done it by now). Why don't I do it?

    Because solving this problem in the general sense is roughly equivalent to writing generic containers. It's not easy to come up with a general solution, and writing once-off hacks is painful after a while. So the result is that you have a culture of subverting type-safety.

    Making up objections because they seem like they'd be problems to you, however, makes you no better than those who c

    ... blah blah blah. You miss the point. I'm not canning these things. Java and Python have a lot of good points. So does C++. C++ has a lot of advantages over java and python. Java and Python have a lot of advantages over C++.

    and presuming you have an automatic test suite running after every compile -- which everyone should, no matter the language

    If you want to talk about what everyone "should" do, they "should" use C++ correctly, by avoiding the dangerous features of the language (-; The language "should" avoid putting requirements on the user, such as developing test suites just to make sure the program is type safe. Of course test suites are good, but they are not a replacement for static checking. This is not an either-or proposition-- a test suite and static checking is more reliable than a test suite alone. Moreover, you get static checking for free in C++, and you can do other things besides checking type safety with your test suites. The other problem with test suites is that when you develop a library, your test suite can't check client code-- so you're requiring your clients to develop test suites as well.

  133. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    If you've got a test suite that runs on every compile, of course, this is less of a problem --

    A lot of problems go away if you test properly, or adopt a number of other sensible practices. Most of the arguments against C++ boil down to what happens when an idiot uses it. The bottom line is that no tool is going to allow idiots to develop large scale applications.

    Regarding speed, btw -- depends on what you're writing, of course, but have you tried particularly new Java runtimes? I've been doing servlets lately, and have been very pleasently surprised by the performance.

    If I were writing internet applications, I'd consider Java. As it is, I'm writing numerical analysis code, and that rules out java. Apart from anything else, bounds-checked element access is a performance killer in itself.

  134. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    The whole argument against C++ in this thread has been that it's not idiot proof enough.

    Erm -- you're right.

    (Might I add, however, that Python *does* have private variables, however little-used they may be. See section 9.6 of the tutorial).

    ...you get static checking for free in C++

    No, you get static checking in C++ if you're not an idiot. It's sickening how many folks (ones who write C++ as if it were C -- something that wouldn't be as much of a problem if backwards compatibility had been ditched) still pass void*s around. The worst case in Java (an Object instance) is solvable -- one can find out what that Object was created as, for instance, or whether it can be safely casted to some other type. The worst case in C++ isn't; given only a void*, there's nothing really you can do with it without risking a segfault.

    Because solving this problem in the general sense is roughly equivalent to writing generic containers.

    Not hard at all. Take an extra parameter on container instanciation that refers to the class name. Every time an Object is passed in, verify that it's a member of that class. Easy. Done. Yes, it requires making a subclass of your container with a new constructor and wrappers for the insertion functions -- but that's all it takes.

    ...a culture of subverting type-safety

    You make that sound far worse than it is. "Subverting type-safety" is what happens in C when folks cast their pointers to (void*). Casting things to Object in Java is far, far safer because the objects still know what they once were, even if the container (usually) doesn't look at that data.

  135. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1

    The bottom line is that no tool is going to allow idiots to develop large scale applications.

    I utterly agree -- but given that an idiot is going to be maintaining my applications, I'd prefer that it be as easy as possible to understand what I'm trying to do and as hard as possible to screw it up.

    As it is, I'm writing numerical analysis code...

    Yup, that's definitely not a Java kind of problem. I haven't done any work in that problem space, so C++ may well be The Right Thing there -- where I work (and play), though, it certainly isn't.

  136. Re: We need an engineer who knows the whole langua by elflord · · Score: 2
    Might I add, however, that Python *does* have private variables, however little-used they may be.

    I've tried using these. Unfortunately, they don't work properly with inheritance.

    Not hard at all. Take an extra parameter on container instanciation that refers to the class name. Every time an Object is passed in, verify that it's a member of that class. Easy. Done.

    Perhaps I'm not understanding ... it looks like you're just doing an up-front runtime type check. I suppose you've at least reduced the problem to something that could be detected with a backtrace.

    You make that sound far worse than it is.

    I don't mean to imply that it's the same thing as a reinterpret_cast -- it's comparable to a dynamic_cast (which is still pretty hideous to a C++ programmer.) Apart from the safety issues, it's also a substantial performance liability. (at least, my experience is that dynamic_cast is very expensive in C++.)

  137. Re: We need an engineer who knows the whole langua by cduffy · · Score: 1
    I suppose you've at least reduced the problem to something that could be detected with a backtrace.

    Exactly.

    Apart from the safety issues, it's also a substantial performance liability.

    Yup, that's part of why Java is slower than C++. I consider it a price worth paying -- and for the kinds of code I write, it is. For what you write, that price probably wouldn't be appropriate -- but them's the breaks.


    Wrt private variables in Python -- hmm. Wouldn't know, haven't used 'em -- I've always just relied on good dicipline in Python to only touch the public interfaces. Of course, if what we're arguing is that it should be hard to do things The Wrong Way, that's not a valid argument... *shrug*. Yet Another Reason Python's not really appropriate for big projects -- but it sure is handy for the little stuff!

  138. Very outdated by devphil · · Score: 2


    No wonder the roundup showed crappy results. They used GCC 2.95.2, which is three years old and uses a library that's even older.

    GCC 3.x uses a rewritten library. I suspect their "library conformance" ratings would be quite different if they'd tested a compiler that's actually supported.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  139. What? by Agermain · · Score: 1

    Because it was offtopic. You made an ontopic comment to an offtopic response, and it was... well, lame. What do you want, 'insightful?'

    Lest being called a hypocrite, I recognize that I'm offtopic too. Wah.

    1. Re:What? by sydb · · Score: 2

      Not only are you offtopic, but you are OUT OF DATE!

      I had karma to burn, so I thought I'd use it getting the karma-free InSaNiAk with his l337 name and zero-content posts modded down. Despite my complaints, I was happy with the results, lame or otherwise ;)

      --
      Yours Sincerely, Michael.
  140. the one const in life.. pointers for a C/C++ world by Mr+Z · · Score: 1

    I think you need an auto first to pick up that volatile chick. Although, I think she'll still restrict your actions to the occasional union though. Besides, you have no class.

    --Joe