Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!brunix!sdm From: sdm@brunix (Scott Meyers) Newsgroups: comp.lang.c++ Subject: Re: Re^2: information hiding Message-ID: <9437@brunix.UUCP> Date: 27 Jun 89 17:04:42 GMT References: <6031@watdcsu.waterloo.edu> <6590164@hplsla.HP.COM> <1421@cbnewsc.ATT.COM> <7709@spool.cs.wisc.edu> <1827@itivax.iti.org> Sender: news@brunix.UUCP Reply-To: sdm@sundry.UUCP (Scott Meyers) Organization: Brown University Department of Computer Science Lines: 15 Actually, it would have been very easy to design C++ in such a way that the private data of a class didn't need to be specified in the class definition: represent each class object as a pointer to the real object. The price you pay, of course, is an extra indirect reference each time you refer to an object. There are other problems as well. This very point is discussed in THE C++ PROGRAMMING LANGUAGE at the end of section 5.3.1, page 145. I was amused to read Stroustrup's discussion of this issue, because a year or so ago this was the question I posed on the programming languages portion of the Ph.D. comprehensive exam here at Brown University. It's an interesting problem, because it reveals how programming language design is influenced by language implementation. Scott