Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: Why use reference type over pointer type? Message-ID: <56410@microsoft.UUCP> Date: 8 Aug 90 17:58:04 GMT References: <1676@dinl.mmc.UUCP> <1806@cs.rit.edu> <422@mole-end.UUCP> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 24 In article <422@mole-end.UUCP> mat@mole-end.UUCP (Mark A Terribile) writes: >> > Its obvious, I'm new to C++. >> > What does does a reference type give me over a pointer type >> > that I've come to love and know well in C? ...... > >This sound like a candidate for an FAQ (frequently asked questions) list. .... People who come from a C background look at C++ and say: Why should I use references when I can do whatever I need to do using pointers? People who come from a OOP background look at C++ and say: Why should I use pointers when I can do whatever I need to do using references? ---- There is two distinct styles of OOP programming in C++. In one style, use of pointers predominates. In the other style, use of references predominates. Given either style, most people find using the other feature convenient, occasionally. People working together on one project probably need to get together and decide which style is going to be used predominately in that project. Unfortunately, this also means that as C++ libraries become available, they will generally follow one of these two distinct styles.