Re: DeleteFile shows as DeleteFileA
"David Ching" <dc@remove-this.dcsoft.com> wrote in message
news:O3SnQ0m2KHA.1388@TK2MSFTNGP02.phx.gbl...
"Pete Delgado" <Peter.Delgado@NoSpam.com> wrote in message
news:#7bEiSm2KHA.5420@TK2MSFTNGP05.phx.gbl...
A leading '_' is reserved for compiler extensions, I believe.
The C++ standard reserves the use of names within the global namespace
that begin with an underscore to the implementation. This means that
class members may indeed begin with an underscore because they are
contained within the class namespace.
You're right, but practically speaking it is still unwise:
class MyClass
{
public:
MyClass()
{
_intMember = 0; // Not obvious that _intMember is a class member and
not a predefined identifier in global namespace
this->_intMember = 0; // using "this->" makes it obvious it is a
class member, but this is really ugly.
}
private:
int _intMember;
}
So I still say using _intMember results in either ambiguity or ugliness.
Saying you *can* do something and saying you *should* do something are two
totally different things! ;-)
I think we could debate the merits of any naming system, but the important
thing is to remain consistent within any code base.
-Pete