Path: utzoo!attcan!uunet!mcvax!ukc!reading!cf-cm!cybaswan!eeartym From: eeartym@cybaswan.UUCP (Dr R.Artym eleceng ) Newsgroups: comp.lang.c++ Subject: Re: Friend specifier considered harmful Message-ID: <75@cybaswan.UUCP> Date: 12 Sep 88 02:36:25 GMT References: <61@cybaswan.UUCP> <424@gt-eedsp.UUCP> Reply-To: eeartym@cybaswan.UUCP (Dr R.Artym eleceng ) Organization: University College of Swansea Lines: 24 In article <424@gt-eedsp.UUCP> baud@gt-eedsp.UUCP (Kurt Baudendistel) writes: > the trick is that this may be true in the general case, but as with most > things in c++, decisions are colored by the magic concept of *efficiency*. > it is often in the programmers' best interests to use friends for this > reason when creating related classes. a good example is vector and > matrix classes. Inline functions are the magic tools that allow us to dispense with the efficiency argument almost all of the time. In any case, the structure of a whole application should never be governed by efficiency, as the 20-80% rule says that we only really need to optimize our inner loops. Inlines strategically placed in those positions can give us the major gains without compromising class isolation. -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~