Path: utzoo!utgpu!attcan!uunet!mcvax!ukc!reading!cf-cm!cybaswan!eeartym From: eeartym@cybaswan.UUCP (Dr R.Artym eleceng ) Newsgroups: comp.lang.c++ Subject: Friend specifier considered harmful Message-ID: <61@cybaswan.UUCP> Date: 25 Aug 88 23:04:41 GMT Reply-To: eeartym@cybaswan.UUCP (Dr R.Artym eleceng ) Organization: University College of Swansea Lines: 24 This is not the flame-attracting exercise that the subject line would seem to indicate --- what I'm really after are the group's opinions on the basic notion that direct access to any data element of another class is *ALWAYS* a bad idea, and should be avoided at all cost. So far I haven't come across any situation where friends are really necessary --- most cases seem to derive from a lack of object-oriented structuring, or the requirements can be met with inline functions. My own concerns lie with the impact of this loosening of the class system on the software engineering aspects of programming. In large systems, small transgressions allow in the bugs. Do YOU have a c++ program that couldn't have been written without the friend specifier? Rich -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Keywords: Parallel, Applicative, and Object-Oriented Languages and Systems --------------------------------------------------------------------------- Dr. Richard Artym, + UUCP : ..!ukc!pyr.swan.ac.uk!eeartym Electrical Engineering Dept., + JANET : eeartym@uk.ac.swan.pyr University of Wales, + Phone : [(0792) or (+44 792)] 295536 Swansea, SA2 8PP, + Fax : [(0792) or (+44 792)] 295532 U.K. + Telex : 48358 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~