My two cents:

kSomeConstant includes the prefix 'k' so that regardless of what expression
it appears in, it is unambiguously a global constant. I'm restating the
obvious here to clarify that the goal is making names obviously global.

Note that a prefix is redundant for any qualified name (appears to the
right of ::). For example, Type::Boolean unambiguously refers to a global-
static data member or a scoped enum value, since 'Type' is not a legal
namespace.

In light of this my preference would be: public enums must be scoped and
named in CamelCase. The style guide would require kCamelCase but it does so
for consistency with public _unscoped_ enums. IMO we'd be better served by
requiring scoped enums, which obviates the 'k' prefix.

Static data members may be referenced without qualification within the
class' scope, so to ensure they are obviously global even there the 'k'
prefix should still be applied.

Reply via email to