>
> 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.


This seems to just add more rules to remember for not that much gain (and
an additional exception to the style guide).

On Fri, Jun 4, 2021 at 8:48 PM Benjamin Kietzman <bengil...@gmail.com>
wrote:

> 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