Path: utzoo!utgpu!attcan!uunet!mcvax!enea!kth!draken!Urd!newsuser From: newsuser@LTH.Se (LTH network news server) Newsgroups: comp.lang.c++ Subject: Re: Friend specifier considered harmful Message-ID: <1988Sep2.094800.16353@LTH.Se> Date: 2 Sep 88 08:47:59 GMT References: <61@cybaswan.UUCP> Reply-To: dag@Control.LTH.Se (Dag Bruck) Organization: Dept. of Automatic Control, Lund Inst. of Technology, Sweden Lines: 31 In article <61@cybaswan.UUCP> eeartym@cybaswan.UUCP (Dr R.Artym eleceng ) writes: > 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. I regard "friend" functions as a way of bending the rules a little, in order to avoid bigger trouble -- rather like a white lie. While this may not be as clean as one would like, it is defendable if you stress practical software engineering. I have seen many Modula-2 and Ada programs where the writer has been "forced" to use very large modules because of too strict encapsulation. > Do YOU have a c++ program that couldn't have been written without >the friend specifier? No, but I think my programs have improved by the use of a few friend functions and classes. General comment: I think this raises the issue that class design is a demanding task, especially if other people are going to use the classes in another conext. Should we start a discussion of GOOD design of classes? Dag Bruck -- -- Department of Automatic Control Internet: dag@control.lth.se Lund Institute of Technology UUCP: ...!enea!control.lth.se!dag P. O. Box 118 S-221 00 Lund, SWEDEN Phone: +46 46-108779