I think this-> is incredibly ugly an unnecessary, what does it really get
us? It will be become convention just as appending a underscore or adding
m_ in front of the name. In my opinion this-> should only be used in
situations where you need to disambiguate between variable names and not as
a convention for member variables.

Brian


On Wed, May 21, 2014 at 2:09 PM, James Peach <jpe...@apache.org> wrote:

> Hi all,
>
> Leif pointed out that I've been doing this, and now I'd like to propose
> this as an official style guideline.
>
>         Within a class member function, access to class members should use
> the explicit "this->foo" syntax.
>
> The rationale for this is that it makes it blindingly obvious that class
> members are being accessed in a way that naming conventions do not. We do
> not have a consistent naming convention for member variables, and at any
> rate, those conventions never apply to accessing member functions. Our code
> is often difficult to read because it takes a long time to figure out
> whether names that are in scope are members, local variables, or
> file-locals.
>
> Obviously, there are cases where using "this->" is overkill, so I'm happy
> for this to be a judgement call.
>
> J
>

Reply via email to