[cfe-dev] convention for naming identifiers

Chris Lattner clattner at apple.com
Thu Nov 18 21:20:30 PST 2010


On Nov 18, 2010, at 7:45 PM, Zhanyong Wan (λx.x x) wrote:

> On Thu, Nov 18, 2010 at 6:31 PM, Ted Kremenek <kremenek at apple.com> wrote:
>> 
>> On Nov 18, 2010, at 6:16 PM, Argyrios Kyrtzidis wrote:
>> 
>>> Since we are talking about preferences that are against the majority of
>>> llvm/clang code, how about lower case for parameters and local variables.
>> 
>> That would be great too.
> 
> I like it.  Since this rule doesn't affect the function signatures, we
> can easily bring legacy code into conformance as needed without
> breaking existing clients.
> 
> I haven't heard from Chris yet, who I assume is in charge of the
> Coding Standards.  Chris, what do you think?  Shall I draft a patch?
> Thanks,

I've been somewhat intentionally staying out of it :).

My thoughts:  I completely agree we should have a standard, it is a mishmash and embarrassing not to :)

I think that method names should either be javaStyle or StrictCamelCase.  I don't have a preference either way.  I tend to use isFoo() and DoFoo() in my code, but that isn't a useful convention to standardize.

There is various code that tries to follow the_stl_conventions, with methods like empty() etc. We have to decide that they are either exceptions or that they should be changed.

I don't have a strong opinion about type names, saying they should start with a capital letter makes sense to me.

-Chris



More information about the cfe-dev mailing list