[cfe-dev] convention for naming identifiers

Ted Kremenek kremenek at apple.com
Thu Nov 18 18:31:49 PST 2010


On Nov 18, 2010, at 6:16 PM, Argyrios Kyrtzidis wrote:

> 
> On Nov 18, 2010, at 6:13 PM, Ted Kremenek wrote:
> 
>> On Nov 18, 2010, at 5:18 PM, Argyrios Kyrtzidis wrote:
>> 
>>> On Nov 18, 2010, at 9:58 AM, Zhanyong Wan (λx.x x) wrote:
>>> 
>>>> On Thu, Nov 18, 2010 at 9:56 AM, Ted Kremenek <kremenek at apple.com> wrote:
>>>>> On Nov 17, 2010, at 10:21 AM, Zhanyong Wan (λx.x x) wrote:
>>>>> 
>>>>>> One question is when a function/variable name should start with a
>>>>>> lower-case letter ("Should I call it getLoc() or GetLoc()?").  Perhaps
>>>>>> we can leave it unspecified for now though.
>>>>> 
>>>>> This is actually one of those points I'd love to disambiguate, or at least make consistent.
>>>> 
>>>> Glad to hear, Ted!  What's the rule you have in mind regarding this?
>>> 
>>> How about lower-case if it's a cheap operation (e.g a simple accessor) and upper if not ?
>>> 
>>> -Argiris
>> 
>> IMHO that leads to the random coding conventions we have now.  :)
>> 
>> I personally prefer that functions/methods start with lower-case characters, and types start with upper-case letters.  I have to admit, however, that it isn't a convention I have strictly adopted in my own code, but wouldn't mind doing so.
> 
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101118/161d94ed/attachment.html>


More information about the cfe-dev mailing list