home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19903 < prev    next >
Encoding:
Text File  |  1993-01-26  |  1.3 KB  |  33 lines

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