Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!ulysses!hector!jss From: jss@hector.UUCP (Jerry Schwarz) Newsgroups: comp.lang.c++ Subject: Re: "Classes are the central concept in C++" Message-ID: <11622@ulysses.homer.nj.att.com> Date: 2 Jun 89 15:32:47 GMT References: <7435@hoptoad.uucp> <9395@alice.UUCP> <7508@hoptoad.uucp> Sender: netnews@ulysses.homer.nj.att.com Reply-To: jss@hector.UUCP (Jerry Schwarz) Organization: AT&T Bell Laboratories Lines: 45 In article <7508@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: >ark@alice.UUCP (Andrew Koenig) wrote: > >My initial reaction is that this is not true. As rebuttal: What >is the "central concept" in C? None immediately springs to mind; there >are a bunch of concepts that all contribute. C++ inherits 99% of those >concepts from C; does the existence of classes render the rest >inconsequential? > >Classes are certainly the most central NEW thing in C++ (as opposed to C); >but that is very different. In this, and other postings, John seems to be advocating the idea C++ is just C with some extensions. (I apologize in advance if this misrepresents his views. The postings leave make this impression very strongly on me.) In some sense, I suppose, this is true, but as an experienced C++ programmer I do not feel it does justice to C++. It is unclear from John's postings how much experience he has had with C++. For example, I think John suggested recently that typedef struct K K ; was both good C and good C++. But my first thought is that this must be code that was originally written in C, or its found in a header file intended for use with both C and C++. In C++ it is as peculiar as if ( NULL == 0 ) ... would be in C. Not wrong, but very peculiar. My experience (and I believe that of others) is that it takes a while after switching to C++ to starting thinking "like a C++ programmer". Designing a C++ program isn't just a matter of using C++ to implement a design that you might have implemented in C. C++ classes make available design strategies that would be awkward or unwieldy in C. C classes are indeed "central concept" in C++. The first and most important question about C++ code is almost always what classes are there and how are values and objects of that class used. Jerry Schwarz AT&T Bell Labs, Murray Hill