Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: Incompatible changes in C++ Summary: Let me second this ... Message-ID: <448@mole-end.UUCP> Date: 24 Nov 90 06:11:20 GMT References: <9011190326.AA13113@mole.ai.mit.edu> <11642@alice.att.com> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 64 Without adding to the rancor, let me amplify Bjarne Stroustrup. In article <11642@alice.att.com>, bs@alice.att.com (Bjarne Stroustrup) writes: > . . . > rms@AI.MIT.EDU (Richard Stallman @ Gatewayed from the GNU Project mailing > list help-g++@prep.ai.mit.edu) writes in response to a note by me: > > . . . > > There is no fundamental or important reason it is not. The real > > features of C++ are upward compatible with C. The problems are all > > superficial. I'm afraid that's not so. I've taught C++ to several dozen people, almost all experience C programs, and none of the real problems have had to do with with the few syntactic incompatibilities. They are simply not an issue. For the non-C programmers, there have been a few problems. A language whose expression syntax allows you to write ( x ) = ( y )( z ) (and to have it take on one of two (C) or more (C++) very different meanings depending upon the declarations of x , y , and z ) will not be easy for a Pascal or FORTRAN programmer to manage. The LHS parens will probably mess up an Ada (TM of DOD, &c.) programmer as well. The C++ .vs. C incompatibilities might be a grave issue if you wanted to write one compiler for both C and C++ (but aren't there some compilers that can handle both?) and they might be a graver issue still if you wanted to integrate another `derived-from-C' language into C++. (Do I hear someone trying to make C++ and Objective C into one language? I find that double- plus objectionable!) > SOME users switching from C to C++ wish that C++ were a superset of C. > MOST users with even a minor amount of C++ experience realize that the > inconveniences caused by the few remaining incompatibilities are minor > and that full ANSI C compatibility would not only invalidate the large > existing body of C++ code but would seriously damage C++'s type system. This is my experience. I've `only' written about 60 000 or 70 000 lines in C++, so of course I'm just a beginner, but it should be obvious to anyone whose worked with code that lives for years that requiring two different initialization syntaxes for built-in and derived types will end up making BOTH `second-class citizens,' by making it impossible to change a type uniformly from one to the other without editing all the code in the system, or requiring the use of macros and conventions for the syntactic forms that will and will not be used. There are other considerations, of course. This is just a particularly obvious, pedestrian, and costly one. > I consider the number of C++/C incompatibilities quite amazing small > giving the difference in aims of the two languages ... I think that > C++'s stated goal of `no gratuitous incompatibilities' or `as close > to C as possible - but no closer' has been met to a larger degree > than anyone would have had the right to expect. Do I hear someone patting himself on the back? Go ahead, you've earned it. But please, please get templates out to us soon! I expect that they will provide a lot of opportunity for code re-use. (I also expect that they will provide a lot of opportunity for ``sugar'' in the language to support maintainable parameterized type packages.) (And I expect they will lead to more pressure for a `compiled header' file to make distribution of templates less an invitation to blatent source-copying.) -- (This man's opinions are his own.) From mole-end Mark Terribile