Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!garfield!stretch!jeff1 From: jeff1@garfield.mun.edu (Jeff Sparkes) Newsgroups: comp.lang.c++ Subject: Re: style guidelines Message-ID: Date: 25 Oct 89 07:53:40 GMT References: <3461@cadillac.CAD.MCC.COM> Sender: news@stretch.MUN.EDU Organization: Memorial University of Newfoundland Lines: 25 In-reply-to: vaughan@puma.cad.mcc.com's message of 24 Oct 89 00:11:17 GMT >>>>> On 24 Oct 89 00:11:17 GMT, vaughan@puma.cad.mcc.com (Paul Vaughan) said: Paul> dag@Control.LTH.Se (Dag Bruck) wrote: Paul> In article <1148@aber-cs.UUCP> pcg@cs.aber.ac.uk (Piercarlo Grandi) writes: >Always prefix globals with ::, members with this->, static members with name:: > > All global identifiers should be prefixed with ::, and all > members with this->; this avoids some very hard to catch bugs. Paul> I haven't been bitten by this yet -- on the other hand, I try to write Paul> very simple programs. I would find all the "::" and "this->" to make Paul> the code less readable, hence more difficult to maintain. Paul> I agree to a certain extent, but I'm thinking of taking up Paul> writing "this->foo" instead of just "foo". In reading other people's Paul> code, members tend to catch me off guard. After going back over some old code, I think I might go even further: Derived::x = 2 * Base::y so that I know where all the variables are from. -- Jeff Sparkes jeff1@garfield.mun.edu || uunet!garfield!jeff1 Humans couldn't have invented golf without alien intervention--Kids in the Hall