home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!charon.amdahl.com!netcomsv!netcom.com!erc
- From: erc@netcom.com (Eric Smith)
- Subject: Re: C++ maintenance
- Message-ID: <1993Jan26.061132.21461@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <C1BnAy.C3F@geovision.gvc.com> <harvey.728009429@regina>
- Distribution: na
- Date: Tue, 26 Jan 1993 06:11:32 GMT
- Lines: 21
-
- In article <harvey.728009429@regina> harvey@opl.com (Harvey Reed) writes:
- >For example, our conventions require:
- >
- >m<name> (m)ember data of a class
- >s<name> (s)tatic data of a class
- >a<name> (a)ctual parameter to a method
-
-
- Two suggestions:
-
- 1. To make member names obvious in a member function, prefix each with
- "this->". E.g., instead of invoking a member function as func()
- invoke it as this->func() (Because prefixing with 'm' or whatever
- is a nonstandard convention which has to be learned by everyone
- who looks at your code, but this->func() has standard C++ meaning
- and is therefore "obvious" to everyone.)
-
- 2. Keep all functions as short as possible, so you can see all local
- names without scrolling around. Functions too big for that are
- also too big to be considered modular. The bigger they are, the
- harder they are to maintain or modify.
-