Jonathan M Davis wrote:
> On Wednesday, September 14, 2011 15:36 dsimcha wrote:
> > On 9/14/2011 5:24 PM, Vladimir Panteleev wrote:
> > > Tiny nitpick: case of "GC" in type/enum names should probably match for
> > > consistency.
> > 
> > Good point. Do we even have a convention for acronyms in variable/type
> > names? If so is it GcAllocator or GCAllocator?
> 
> We haven't been entirely consistent. For instance, we have UtfException, but 
> _every_ other case of utf in the code is either utf (at the beginning of a 
> function) or UTF (I have a pull request which includes fixing the casing on 
> UtfException to match everything else). Given the choice, I'd definitely say 
> that GC should be used and not Gc, and everywhere in Phobos where I've 
> created 
> a function which had an acronym in it, that's what I've done, but without 
> going through the whole code base, I don't know which convention is more 
> common (other than the case of Utf where I did go looking; it's easier when 
> you know what the acronym is rather than looking for _all_ acronyms). I don't 
> think that acronyms have been all that common in general though.

When I had first glance at GCAllocator I observed this as well. I
believe GcAlloctor is the better way to camelize it even though druntime
has a class GC. It's easier to read for me, consider XMLToHTMLConverter
vs. XmlToHtmlConverter or worse XMLHTMLConverter vs. XmlHtmlConverter.
See http://stackoverflow.com/questions/1176950/acronyms-in-camel-back

In sum I'd like to follow Java convention. I can also live with
GCAllocator if that's more consistent with the current style. But it
should definitely be fixed in the style guide.

Jens

Reply via email to