Naming convention in Phobos

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 8 16:33:17 PST 2011


On Tuesday, March 08, 2011 15:42:47 Emil Madsen wrote:
> Just a thought, is there some sort of tool whats able to check if a code
> follow these standards?
> And if its the case, why isn't it used? - so people are forced to conform
> to the coding standard before being able to commit anything.

No one is forced to conform to any standard. You can code however you like. Now, 
if you're submitting code to Phobos, it should follow Phobos' naming 
conventions, and perhaps we should do a better job about making those clear, but 
for the most part, anyone working on Phobos is already aware of them.

Tools do exist to check style conformance for a variety of languages. I'm not 
aware of any which exist for D at present, but you might be able to coerce one 
for a language like C++ to do it. Regardless, it's not like the D community at 
large is being forced to follow the same naming conventions in their code that 
Phobos is using. I'd say that it's _preferred_ that they do for general code 
readability and such, but everyone is free to use whatever naming conventions 
that they prefer in their own code. Neither the lanugage no the compiler forces 
any sort of naming conventions on anyone beyond the basic rules of which 
characters an identifier can contain and that an identifier can't be a keyword.

- Jonathan M Davis


More information about the Digitalmars-d mailing list