[cfe-dev] convention for naming identifiers

Ted Kremenek kremenek at apple.com
Thu Nov 18 18:13:15 PST 2010


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101118/5cec4c11/attachment.html>


More information about the cfe-dev mailing list