[LLVMdev] RFC: variable names

Chris Lattner clattner at apple.com
Mon Oct 13 15:23:04 PDT 2014


On Oct 13, 2014, at 3:19 PM, Chandler Carruth <chandlerc at google.com> wrote:

> On Mon, Oct 13, 2014 at 3:04 PM, Nick Kledzik <kledzik at apple.com> wrote:
> I’d like to discuss revising the LLVM coding conventions to change the naming of variables to start with a lowercase letter.
> 
> Almost all of your negatives of the current conventions also apply to your proposed convention.

Fair point.

> 
> Type names: CamelCase
> Function names: camelCase
> Variable names: ???
> 
> If we name variables in camelCase then variable names and function names collide.

I haven’t seen confusion here in practice.  The problem between types and variables is that they are often both nouns.  Functions are usually verbs, and calls almost always have parentheses, which makes usage unambiguous.

> If we are going to change how we name variables, I very much want them to not collide with either type names or function names. My suggestion would be "lower_case" names.

Ick.  :-)

-Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141013/fab05988/attachment.html>


More information about the llvm-dev mailing list