I agree in the extreme with Jeff here. Foo::Bar, in an expression context, 
cannot be anything other than a value. For me, at least, I have never noticed 
this adding any overhead in reviews - it’s immediately obvious what’s 
happening. I suspect that if it *does* add overhead for you, you’ll find that 
overhead disappearing as you get more used to reading such code. Adding a 
prefix like eFoo or kFoo is just visual noise that is actively harmful, because 
in combination with our 80-character limit for lines, it pushes us into more 
awkward code formatting that makes things harder to read in a very real sense. 
Awkward line wrapping like that *definitely* makes it harder for me to review 
code in a very real way.

If we want to have some additional visual indication that we’re looking at an 
enum value, I suggest just using Foo::BAR, which is already in use in some 
parts of the code and which I think is extremely unambiguous.

Thanks,
- Seth


> On Apr 8, 2016, at 3:17 PM, Jeff Gilbert <jgilb...@mozilla.com> wrote:
> 
> It's noisy in code you *do* understand, which is the bulk of the code
> we should be dealing with the majority of the time.
> 
> I do not parse this initially as a type because that generally doesn't
> make sense given context.
> Generally the names involved are also unlikely to be types, based on name 
> alone.
> 
> It would also add to our already-pungent code smell.
> 
> On Fri, Apr 8, 2016 at 3:03 PM, Mats Palmgren <m...@mozilla.com> wrote:
>> On 2016-04-08 23:03, Jeff Gilbert wrote:
>>> 
>>> Strong preference against eFoo, here. :)
>> 
>> 
>> Strong preference *for* eFoo, here. :)
>> 
>> If I see Bar::Foo anywhere in code I'm not familiar with, my brain
>> is likely to first parse that as a type before realizing that, hmm
>> that doesn't make sense in an expression context, and then I will
>> likely have to lookup what that silly Bar thing is just to be sure.
>> 
>> eFoo is unambiguous and utterly clear.
>> 
>> /Mats
>> 
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

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

Reply via email to