[Ns-developers] How to be conform to coding style
Tom Henderson
tomh at tomh.org
Sun Jun 7 21:43:25 PDT 2009
Mirko Banchi wrote:
>
> Il giorno 07/giu/09, alle ore 15:06, Tom Henderson ha scritto:
>
>> Mathieu Lacage wrote:
>>> On Sun, 2009-06-07 at 01:35 +0200, Mirko Banchi wrote:
>>>>>> MgtAddBaRequestHeader
>>>>>> MgtAddBaResponseHeader
>>>>>> MgtAddDelBaHeader
>>>>>> or other?
>>>>>> Any advice is very useful!
>>>>>> Sorry for this very little question, but this is very important
>>>>>> in order to avoid a large number of future changes.
>>>>> I'd probably choose AddBA, DelBA, but I don't care strongly.
>>>>>
>>>>> - Tom
>>>>
>>>> Ok, i'll choose
>>> As usual with coding style, there is no strict rule but the guideline is
>>> that we are trying to use MixedCaps to outline word boundaries where the
>>> definition of 'word' is, of course, subject to interpretation but, we
>>> expect you to use good taste in your interpretation.
>>
>> Hi, I think you are right that the current coding style guide
>> specifies this choice for acronyms-- I will add this as another
>> example (e.g. "even two-word acronyms such as BlockAck (BA) or
>> Internet Protocol (IP) should be included as Ba or Ip, respectively").
>>
>
>
> Sorry if i have another question but maybe this could be useful to
> improve the coding style guide.
> How we should declare a static const member of a class?
>
> MyClass {
> ...
>
> private:
> static const m_variable
> or
> static const M_VARIABLE
> or other?
>
> }
The convention has been to use all uppercase for these, as well as enum
constants. The coding style says:
"Defined constants will be all uppercase letters or numeric digits, with
an underscore character separating words. "
Tom
More information about the Ns-developers
mailing list