[LLVMdev] [cfe-dev] draft rule for naming types/functions/variables
Chris Lattner
clattner at apple.com
Fri Dec 3 23:14:04 PST 2010
On Dec 3, 2010, at 8:03 PM, Thiago Farina wrote:
> On Mon, Nov 29, 2010 at 5:02 AM, Anton Korobeynikov
> <anton at korobeynikov.info> wrote:
>>> I enjoyed the new coding style in recent patches. Camel case makes it easy
>>> to pick a descriptive name. Starting functions and variables with lower
>>> cases reduces chances to conflict with a type name.
>> Honestly speaking, I don't. Especially in the cases when varname is
>> made from an
>> acronym. E.g. MachineInstr *MI looks much better than MachineInstr *mi, etc.
>>
>
> Hum? I don't think MI is better. I haven't see this style until
> clang/llvm. Many others open source projects just uses the normal
> lower case variable, which is MUCH better IMO.
>
> For me is confusing to have a variable starting with captial letter,
> because it's hard to differentiate it from class names.
Thiago,
The coding standards (which have been finalized and comitted) don't dictate names for local variables.
-Chris
More information about the llvm-dev
mailing list