[phobos] Initial Phobos style guide proposal

Jonathan M Davis jmdavisProg at gmx.com
Tue Apr 5 14:49:49 PDT 2011


> On 3/30/2011 8:00 PM, Jonathan M Davis wrote:
> > These are intended to be general guidelines which are followed most of
> > the time but can be broken within reason (though hopefully that's
> > relatively rare).
> 
> I'd like to see this as changes (as necessary) to the D style guide
> http://www.digitalmars.com/d/2.0/dstyle.html, not as something distinct and
> possibly in contradiction with it.

Some of the itmes on the list (such as public symbol naming conventions) 
probably should go in an update to the D style guide. However, some of the 
others, don't really make sense there, and even if want want to follow them in 
Phobos, we still wouldn't want them in the D style guide - such as "Prefer ? : 
to if/else within reason," or "If you need to use a version block for 
documentation, use version(StdDoc), not version(D_Ddoc)." So, depending on 
what we settle on, we may need a second guide which lists specific additional 
stuff that applies specifically to Phobos (or we could add a section at the 
bottom of the current guide which was specific to Phobos). However, since most 
of the stuff that would need to be specific to Phobos is primarily stuff that 
details how code within a function should be written and there's definite 
resistance to having a style guide which lists that sort of thing, we may end 
up with a list which is pretty much just stuff which pertains to the public 
API and therefore fits just fine in the D style guide.

Regardless, the current D style guide should be updated based on what we 
decide for Phobos, or it should be gotten rid of. We shouldn't have an out-of-
date guide like that sitting on the main site as if it's what we followed. So, 
either it needs to be what we follow, or it shouldn't be there.

- Jonathan M Davis


More information about the phobos mailing list