On Mon, Apr 11, 2016 at 5:17 PM, Chris Peterson <cpeter...@mozilla.com>
wrote:

> On 4/8/16 8:10 AM, Kartikaya Gupta wrote:
>
>> Is there a recommendation for what enum values in C++ code should be
>> styled as? The coding style doesn't say and we use a variety of things
>> in existing code, so I was wondering if we should settle on something
>> for new enums being added to the code, and update the style guide
>> accordingly.
>>
>
> FWIW, Google's C++ Style Guide dictates that enums in new code use
> kPrefixedNames. SHOUTY_CAPS are allowed in older code.
>
> https://google.github.io/styleguide/cppguide.html#Enumerator_Names


That's for enum. But for enum class, that probably doesn't make that much
sense.

In terms of readability, I probably agree with prefixing the items with "e"
so that people do know it is an enum constant. An additional "e" isn't
ridiculous long, so this tradeoff should be considered acceptable.

- Xidorn
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to