[llvm-commits] [llvm] r137497 - /llvm/trunk/docs/CodingStandards.html

David Blaikie dblaikie at gmail.com
Fri Aug 12 15:15:06 PDT 2011


> it's about making the
> behavior of code clearer to readers who haven't already
> internalized its idioms.

Agreed - though in that regard to this specific case (local v
non-local) I tend to fall towards Chris's point of view: that names
should be descriptive enough that their intent is clear. That means
short scoped variable names can have short names because their intent
is clear by context. Longer scoped names may need more descriptive
names because you can't see their use/intent easily in one go. This
applies regardless of the particular kind of scope (local,
global/namespace, static/non-static member, etc). The specific fact
that "this is a (non-static?) member variable/field" is certainly
something that isn't immediately obvious, but for myself I'm not sure
it's sufficiently important to call it out with a naming convention -
if names follow the general approach of "broader scopes need more
descriptive names" (certainly there are exceptions) it seems good
enough to me.




More information about the llvm-commits mailing list