|
![](/i/fill.gif) |
Darren New <dne### [at] san rr com> wrote:
> I think the same goes for putting "m" or "g" or whatever in for member or
> global variables, etc.
Why? When I started using those, my own code became much easier to
understand to me months later. When I have code along the lines of:
void Foo::doSomething()
{
mCounter += someValue;
}
or:
void Foo::doSomething()
{
gCounter += someValue;
}
as opposed to:
void Foo::doSomething()
{
counter += someValue;
}
the first two are much clearer than the third one. The third one doesn't
make it clear at all where 'counter' might be defined, while in the first
example it's clear that it's a member variable of the Foo class, and in
the second one it's clear that it's not. In the third one it could be
anything.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |