Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!hplabs!hp-pcd!hplsla!bobk From: bobk@hplsla.HP.COM ( Bob Kunz) Newsgroups: comp.lang.c++ Subject: Re: C++ as a better C (fact or fiction)? Message-ID: <6590051@hplsla.HP.COM> Date: 16 May 88 17:54:57 GMT References: <6590041@hplsla.HP.COM> Organization: HP Lake Stevens, WA Lines: 132 As a followup to my question, I thought I would include some of the mail responses I received on C++ as a better C...... (I've deleted the re-writes of my original question for brievity) Bob Kunz ------- From hplabs!snyder@hplabsz Thu May 5 08:38 PDT 1988 Date: Thu, 5 May 88 08:13:10 pdt Organization: Hewlett-Packard Laboratories In article <6590041@hplsla.HP.COM> you write: > blah, blah, blah Our observation is that most C++ users are either using it as a "better C" or are using it to create data abstractions, as opposed to full object-oriented programming (with polymorphism and inheritance). The latter folk might say they are doing object-oriented programming, however. I think it is quite reasonable to use C++ as a "better C". Alan ------- From sun!dhelrod Thu May 5 10:25 PDT 1988 Date: Thu, 5 May 88 08:31:34 PDT Organization: Sun Microsystems, Mountain View In article <6590041@hplsla.HP.COM> you write: > blah, blah, blah Caution: I have written less than 20,000 lines of C++ code! I would say that it depends on your programming style. I am a "hacker". I tackle a problem by writing a piece, and then adding some and then adding some more. When I finally have a kludge that works, then I figure I probably have a good understanding of the solution. Only at this point do switch to "architect/planner" mode. I sit down and plan out an elegent solution that that I not embaressed to let others see and use. C++'s type checking is more forgiving than lint. So, to me it does a GREAT job as a "better C". When I am in hacker mode, I find that my code development goes MUCH faster with this kind of feedback. (If C++ was a little better about actually identifying the line a problem occured on, it would be easier, but I have learned to intuit what it means instead of what it says.) I have (twice) written programs in C++ and then "ported" them to C. This would have been made easier with an ANSI C compiler (function definitions, etc.). Designing a good orthogonal, complete but not to restrictive, class is REALLY tough! More experienced C++ users say that there are no tricks here. Experience makes it easier, but choosing the right functionality is non-trivial. When in "architect/planner" mode, I find the OO aspects of C++ to be fun and useful. The programs are much easier to read, write and understand. I believe that as I get better at class design, I'll more use the OO capabilities earlier in my process. I hope you summarize the responses you get and post the summary to the net. David H. Elrod Graphics Products Division. Sun Microsystems, Inc. dhelrod@sun ------- From ihlpe!dopey Thu May 5 12:57 PDT 1988 Date: Thu, 5 May 88 08:54:08 PDT Organization: AT&T Bell Laboratories - Naperville, Illinois Funny (and very impractical). I've found that I really don't enjoy using C any more because C++ has the typechecking and all. The problem is, I've also gotten used to classes, so it's hard to do the "reduced"C++/"enhanced" C type coding. As an intermediate step, using C++ as enhanced C is reasonable; but using C++ changes your model so eventually you really can't use it as just an extension. well, for me anyway. james blasius ihnp4!gomez!dopey ------- From ulysses!north Fri May 6 10:53 PDT 1988 Date: Thu, 5 May 88 16:54:01 EDT Organization: AT&T Bell Labs, Murray Hill fact wouldn't go back to C even ANSI C noalias indeed -- Parturiunt montes, nascetur ridiculus mus! ------- From fischer@uunet.UU.NET Sun May 8 19:31 PDT 1988 Date: Sun, 8 May 88 22:36:01 +0200 Organization: Dept. of Comp. Sci., Aalborg University, Denmark In article <6590041@hplsla.HP.COM> you write: > blah, blah, blah Well, I shifted (incremented ?) from C to C++ a while back, and has been using C++ ever since. This includes both larger projects, where the OOP style is mandatory, and smaller thing where it is simply nice to have the compiler check function arguments etc. I do have an ANSI C compiler (GNU), but I don't use it much. Once you have started using C++ you might as well stick to it---no point in using two languages, you'll just end up being utterly confused. It seems to me that if you start using C++ as simply a better C you will soon start using some of the features that makes C++ stand out. After a while you come to depend on it! We will of course need to program i C for many years to come---there is simply too much code out there that has to be maintained*. Regards, Lars *Fortran's not dead, it just smells funny. -- Lars Fischer, fischer@iesd.dk, {...}!mcvax!diku!iesd!fischer Life is hard, and then you die.