Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ucsd!ames!pacbell!att!cbnewsc!nevin1 From: nevin1@cbnewsc.ATT.COM (nevin.j.liber) Newsgroups: comp.lang.c++ Subject: Re: information hiding Message-ID: <1421@cbnewsc.ATT.COM> Date: 26 Jun 89 04:23:43 GMT References: <6031@watdcsu.waterloo.edu> <6590164@hplsla.HP.COM> Reply-To: nevin1@ihlpb.ATT.COM (nevin.j.liber) Organization: AT&T Bell Laboratories Lines: 21 In article <6590164@hplsla.HP.COM> jima@hplsla.HP.COM (Jim Adcock) writes: |Someone else wrote: |> Ultimately, I would like to give them a library containing my classes and |> NOTHING else. |Why? Seems like letting people see a little bit of your class might be a |good thing. I find it very comforting to be able to look at complex.h for |example. Reading it, I get the impression that the person writing it might |very well know what they're doing. Yet not enough is given away that I |could /cause/get into/ any trouble. Maybe, maybe not. Programmers are clever people :-); they tend to use ALL the information they are given. From the header file one might guess on how the class is implemented, find some undocumented side effects, and write code that uses these side effects. This breaks the clean interface which classes provide, and leads to many of the "existing practice" problems which can be found throughout pANS C. I'd much rather have all the implementation details for a class hidden from me. -- NEVIN ":-)" LIBER AT&T Bell Laboratories nevin1@ihlpb.ATT.COM (312) 979-4751