Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!ucbvax!hplabs!hp-pcd!hplsla!jima From: jima@hplsla.HP.COM (Jim Adcock) Newsgroups: comp.lang.c++ Subject: Re: using references vrs. pointers Message-ID: <6590087@hplsla.HP.COM> Date: 27 Jan 89 18:10:06 GMT References: <417@vilya.UUCP> Organization: HP Lake Stevens, WA Lines: 17 > Any comments? Sounds like dogma to me. Good pointer support is much of what makes C and C++ more efficient than other languages. I believe that one needs to feel comfortable with the duality of thinking of an object either as a chunk of memory, or as the address of that chunk of memory. Both interpretations of an "object" have their usefulness. Using and understanding both interpretations need not lead to wild confusion. The question remains in my mind -- in general should a class implementer write public methods that pass by reference, or pass a pointer? [For methods requiring more than one object.] I think in general objects should be passed by reference, not by pointer. In the internal implementation of those methods the class implementator should feel free to use either pointers or references, whichever is most suitable to the task at hand. Comments?