TITLE: simple, "intuitive" member variable naming (Newsgroups: comp.lang.c++.moderated, 5 Feb 97) [ I usually avoid postings involving naming conventions, since they usually are Hungarian-notationalists versus everyone else. Here is a simple, non-obtrusive convention. -adc ] KUEHL: kuehl@uzwil.informatik.uni-konstanz.de (Dietmar Kuehl) >> >BTW, I can't really understand why there is so much interest in symbols >> >with leading underscore: I find them plain ugly and would not use them >> >anyway (accept when I would implement parts of the standard C/C++ >> >library, of course ...). [snip] >> The use of a leading _ is an attempt to put member variables into >> a private namespace which helps to avoid conflicts with other names. [ The obvious side benefit is a consistent naming convention makes it painless to recognize member variables in other people's code. -adc ] [snip] APPLETON: appleton@chiefs.northbrook.aieg.mot.com (Brad Appleton) I came up with my own little convention for this that I strongly prefer to the "underscore" solution. I use a prefix of "my" on data-members. For example: class SomeObject { private: int myLength; ThingList myThings; }; Its almost as brief as using a single underscore, and is much more textually informative and intuitive IMHO. I tend to use a prefix of "our" for static class data-members.