Fixing enum names in Phobos

KennyTM~ kennytm at gmail.com
Mon Aug 1 02:15:15 PDT 2011


On Aug 1, 11 16:00, Alex Rønne Petersen wrote:
> On 01-08-2011 09:39, Jonathan M Davis wrote:
>> On Monday 01 August 2011 15:02:54 KennyTM~ wrote:
>>> On Aug 1, 11 13:56, %u wrote:
>>>> How do you plan on camelCasing pure, nothrow, out, ref, etc?
>>>
>>> pure_, nothrow_, out_, ref_
>>>
>>> pureAttribute, nothrowAttribute, outAttribute, refAttribute
>>
>> Yeah. Something like that. You'd have to add a prefix or a suffix to
>> them all.
>> But the fact that you can't actually just camelcase them might be a good
>> argument for leaving them as-is. If we're willing to change them
>> though, a
>> simple prefix or suffix shouldn't be all that big a deal - especially
>> if it's
>> shorter rather than longer.
>>
>> - Jonathan M Davis
>
> I may very well be biased since I come from .NET land, but I have to
> say, camel case enum member names do seem a bit weird to me. While enum
> members could be argued to be fields, they certainly don't have those
> semantics, so maybe pascal case might not be so bad?
>
> - Alex

In .NET (almost) everything is CapitalCamelCased :D

Anyway, the rule of thumb is
  - Things are CapitalCamelCased if they can create a type
  - Otherwise, they are smallLetterCamelCased

Enum members aren't types, so they shouldn't be CapitalCamelCased.



More information about the Digitalmars-d mailing list