On 04/08/2016 06:10 PM, 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.enum OptionA { ALL_CAPS_VALUES, THIS_IS_LIKE_SHOUTING }; enum OptionB { SentenceCaseValues, ThisMightBeConfusedWithOtherThings }; enum OptionC { eSentenceCaseValues, eThisSeemsPopular };
Hmm, I thought we had eFoo in coding style, but don't see it there. Personally I don't like all caps, since those looks like macros, and CamelCase looks like type name. So I'd prefer e-prefix, and for example all the event names moved to use that syntax recently (well, the names used to be #define SOME_EVENT). That made, IMO, the code easier to read. -Olli
Others? kats
_______________________________________________ dev-platform mailing list [email protected] https://lists.mozilla.org/listinfo/dev-platform

