Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!decwrl!synoptics!frose From: frose@synoptics.COM (Flavio Rose) Newsgroups: comp.lang.c++ Subject: Re: Why use reference type over pointer type? Summary: Why I prefer the C way Message-ID: <21810@lute.com> Date: 4 Aug 90 00:23:30 GMT References: <1676@dinl.mmc.UUCP> <5720@darkstar.ucsc.edu> Organization: SynOptics Communications Inc. Mountain View, Ca. Lines: 22 The beauty of the C way of doing call-by-reference is the following: Suppose you are reading or debugging someone else's code (a very common activity), and you come across a call foo(a,b,&c); and a, b, c are of scalar type. Then you can say immediately, without bothering to look up foo's function prototype anywhere, "aha, foo munges c but not a or b." Often you don't care to know more about foo() than that, so this saves time and doesn't make you interrupt your train of thought to look up a prototype. (I think liking little old-fashioned conveniences of this kind makes one fall into a kind of pattern, which I call "troglodytic programming." In opposition to troglodytic programmers we find the futurists, who always follow the latest fad, place an assertion after every statement so their code will be fully self-checking, and are eager to reach the Nirvana of "nonprocedural code.")