<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Oct 13, 2014, at 5:23 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" class="">chisophugis@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><br class="Apple-interchange-newline"><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Mon, Oct 13, 2014 at 5:09 PM, Jim Grosbach<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:grosbach@apple.com" target="_blank" class="">grosbach@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><div class=""><div class="h5"><blockquote type="cite" class=""><div class="">On Oct 13, 2014, at 4:31 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Oct 13, 2014 at 4:14 PM, Chandler Carruth<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:chandlerc@google.com" target="_blank" class="">chandlerc@google.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="">1. Initialisms. It's common in Clang code (also in LLVM?) to use initialisms as variable names. This doesn't really seem to work for names that start with a lower case letter.</div></blockquote><div class=""><br class=""></div></span><div class="">I think wee at least need a good answer to this.</div></blockquote></div><br class="">As I really suspect this is the most important point to address, let me make an attempt:</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">Variable names are *either* initialisms, written as all caps, or terms written in lower case and separated by underscores. For the purposes of variable naming "terms" can include words but also extremely common and recognizable abbreviations within LLVM such as "rhs", "lhs", or "gep". These types of terms should not be written as initialisms but as words. For example, you might write "LE" or "lhs_expr" for the Left-hand Expression, but not "LHSE" or "LHS_expr".</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">While I'm trying to avoid it, this has the advantage of leaving a large number of initialisms in the existing code base as "stylish".</div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra">I'm not really happy with this rule, but it is the least disruptive and most consistent I can come up with. I would also be happy encouraging people to not use initialisms excessively or if confusing. I think the current codebase uses them more than is helpful.</div></div></div></blockquote><div class=""><br class=""></div></div></div><div class="">This makes sense to me. I think it strikes a good balance between updating our conventions to be better and also reflecting common in-practice usage patterns.</div></div></div></blockquote><div class=""><br class=""></div><div class="">This convention sounds like it would cause people to have to be constantly asking themselves "is this common enough to be an initialism-as-word or not?". The thing that started this conversation was someone complaining about going between codebases that they weren't sure whether to capitalize; now that person will have to get a feel for the local initialism-as-word's, which is a much greater burden than just the naming convention.</div></div></div></blockquote><div><br class=""></div><div>Perhaps, but IMO, I think we’d get a long way with a “If you really have to stop and ask, it’s not common enough,” guideline.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_quote" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><br class=""></div><div class="">-- Sean Silva</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><span class=""><div class=""><br class=""></div><div class=""><blockquote type="cite" class="">FWIW, I think that having different naming conventions for data members and local variables has become essentially untenable with lambdas and capture.</blockquote><br class=""></div></span><div class="">Can you elaborate a bit more on this? Maybe an example or two.</div><div class=""><br class=""></div><div class="">I’m very supportive of the general direction of all of this. Glad to see the general consensus developing.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">-Jim</div><div class=""><br class=""></div></font></span></div></div><br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" class="">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/" target="_blank" class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank" class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></blockquote></div></div></blockquote></div><br class=""></body></html>