[PATCH] D57896: Variable names rule

Michael Platings via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 19 05:19:57 PST 2019


michaelplatings added a comment.

In D57896#1402194 <https://reviews.llvm.org/D57896#1402194>, @lattner wrote:

> > Changed recommendation for acronyms from lower case to upper case, as suggested by several responses to the RFC.
>
> I haven't been following the discussion closely - why is this the preferred direction?  I don't think that things like "Basicblock *bb" or "MachineInstr *mi" will be confusing, and going towards a consistently leading lower case letter seems simple and preferable.


Maybe I misunderstood you (http://lists.llvm.org/pipermail/llvm-dev/2019-February/130223.html):

>> Maybe there should be an exception that variable names that start with an acronym still should start with an upper case letter?
>  That would also be fine with me - it could push such a debate down the road, and is definitely important for a transition period anyway.

Also Chandler (http://lists.llvm.org/pipermail/llvm-dev/2019-February/130313.html):

> FWIW, I suspect separating the transition of our acronyms from the transition of identifiers with non-acronym words may be an effective way to chip away at the transition cost... Definitely an area that people who really care about this should look at carefully.

And Sanjoy (kind of) (http://lists.llvm.org/pipermail/llvm-dev/2019-February/130304.html):

> maybe a gradual transition plan could be to allow these upper case acronyms for specific classes?

I agree that lower case acronyms would ultimately be more consistent, but given where we are it seems more achievable to only change the rule for non-acronyms.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57896/new/

https://reviews.llvm.org/D57896





More information about the cfe-commits mailing list