Fixing enum names in Phobos

Jonathan M Davis jmdavisProg at gmx.com
Mon Aug 1 01:11:30 PDT 2011


On Monday 01 August 2011 10:00:01 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?

Camelcasing for enum values is what was decided upon, and all of the newer 
Phobos stuff follows it. It's just some of the older stuff (primarily stuff which 
was around in D1, I believe) which doesn't follow the correct naming 
conventions for enums. We may very well decide that it's not worth fixing these 
enums to follow the correct naming conventions for Phobos, but the correct 
naming conventions have already been decided on. Enum types are pascal cased, 
and their values are camelcased. That's not up for discussion at this point. 
What _is_ up for discussion is whether fixing these enums to follow Phobos' 
naming conventions is worth the code breakage that it will cause.

- Jonathan M Davis


More information about the Digitalmars-d mailing list