On 04/10/2016 05:50 PM, Aryeh Gregor wrote:
On Fri, Apr 8, 2016 at 8:35 PM, smaug <sm...@welho.com> wrote:
enum classes are great, but I'd still use prefix for the values. Otherwise the 
values look like types - nested classes or such.
(Keeping my reviewer's hat on, so thinking about readability here.)

In some cases I think it's extremely clear, like this:

   enum class Change { minus, plus };

whose sole use is as a function parameter (to avoid a boolean
parameter), like so:

   ChangeIndentation(*curNode->AsElement(), Change::plus);

In cases where it might be mistaken for a class, it might make more
sense to prefix the enum class name with "E".  I don't think this
should be required as a general policy, though, because for some enums
it might be clear enough without it.


Indeed in your case it is totally unclear whether one is passing a function 
pointer or enum value as param.
If the value was prefixed with e, it would be clear.

Consistency helps with reviewing (and in general code readability) a lot, so 
the less we have optional coding style rules, or
context dependent rules, the better.




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

Reply via email to