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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!sgiblab!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: C++ maintenance
  5. Message-ID: <9302813.19105@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <C1BnAy.C3F@geovision.gvc.com> <harvey.728009429@regina> <1993Jan26.061132.21461@netcom.com>
  9. Distribution: na
  10. Date: Thu, 28 Jan 1993 02:49:43 GMT
  11. Lines: 27
  12.  
  13. erc@netcom.com (Eric Smith) writes:
  14.  
  15. >In article <harvey.728009429@regina> harvey@opl.com (Harvey Reed) writes:
  16. >>For example, our conventions require:
  17. >>
  18. >>m<name>       (m)ember data of a class
  19. >>s<name>       (s)tatic data of a class
  20. >>a<name>       (a)ctual parameter to a method
  21. >
  22. >Two suggestions:
  23. >
  24. >1.  To make member names obvious in a member function, prefix each with
  25. >    "this->".  E.g., instead of invoking a member function as func()
  26. >    invoke it as this->func()  (Because prefixing with 'm' or whatever
  27. >    is a nonstandard convention which has to be learned by everyone
  28. >    who looks at your code, but this->func() has standard C++ meaning
  29. >    and is therefore "obvious" to everyone.)
  30.  
  31. A good suggestion. You can also prefix static data of a class with
  32. "classname::", instead of using s<name>, and global variables
  33. can be prefixed with "::".
  34.  
  35. -- 
  36. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  37. This .signature virus is a self-referential statement that is true - but 
  38. you will only be able to consistently believe it if you copy it to your own
  39. .signature file!
  40.