[LLVMdev] RFC: variable names
clattner at apple.com
Mon Oct 13 15:21:23 PDT 2014
On 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. This should not be a discussion on the pain of such a transition, or how to get from here to there, but rather, if there is a better place to be.
> 5. Momentum only. When I’ve talked with various contributors privately, I have found no one who says they likes capitalized variables. It seems like everyone thinks the conventions are carved in stone…
Personally, I think that lower case local variables are the way to go. I could see it either way for instance variables, but being lower case is consistent.
> My proposal is that we modify the LLVM Coding Conventions to have variable names start with a lowercase letter.
> Index: CodingStandards.rst
> --- CodingStandards.rst (revision 219065)
> +++ CodingStandards.rst (working copy)
> @@ -1073,8 +1073,8 @@
> nouns and start with an upper-case letter (e.g. ``TextFileReader``).
> * **Variable names** should be nouns (as they represent state). The name should
> - be camel case, and start with an upper case letter (e.g. ``Leader`` or
> - ``Boats``).
> + be camel case, and start with a lower case letter (e.g. ``leader`` or
> + ``boats``).
> * **Function names** should be verb phrases (as they represent actions), and
> command-like function should be imperative. The name should be camel case,
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev