kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #05410
Re: Coding Style Guide
On 09/13/2010 08:52 AM, Alex G wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>
>
>>> Thanks! One particular item of interest to me is that I wasn't able
>>> gauge is the use of "this->" to explicitly state that the variable is a
>>> member of the object. Is this acceptable?
>>>
>>>
>> No. This is not really C++. What you talk about is often done in Java,
>> but I don't like that either, and I don't personally do that. This was
>> another reason for using the 'a' prefix in front of argument names, so
>> that you can be sure you will never collide between a member variable
>> name and an argument.
>>
>>
>>
> That seems to be the consensus. And given the naming convention, I must
> agree. This should be added to the coding guidelines.
>
I will add do not use 'this->'.
I would not have thought it to be a problem until I just now grepped for it:
$ grep -R 'this->' .
and see it is seeping in from folks that have not lived long enough in
the C++ world yet.
Dick
Follow ups
References