Notes on the Phobos style guide

Jonathan M Davis jmdavisprog at gmail.com
Mon Aug 16 16:54:11 PDT 2010


On Monday, August 16, 2010 15:59:14 bearophile wrote:
> Jonathan M Davis:
> > Obviously, in my own code, I'm just going to code the way that I like,
> > and I see no point in any kind of standard D style guide with regards to
> > braces and other visual elements to relate primarily to how the code
> > looks rather than what it does.
> 
> Often you need to modify legacy C/C++/Java code, or you need to work in a
> team, in such very common situations it's often better to follow some
> style standard.

Well, yes, but if I have a choice, I'm going to code in the manner which I like 
best - like where to place braces and where to put spaces and how many. It's not 
like I code in obfuscated D (or C/C++/Java/whatever). I think that most people 
who are consistent in their coding style produce understandable code. The 
problem is when you have to share or when you have a really bizarre style that 
no one else understands. I see little no value in trying to enforce any kind of 
coding standard on the D community as a whole, just like I see no value in doing 
it to the C++ community. Now, a particular _project_ - such as Phobos can benefit 
from a particular style since you're dealing with a group of contributors, but 
with my own code - even if I make it publicly available -  there shouldn't be 
any problem in coding in my own style as long as it's reasonably readable. It's 
only when dealing with projects that it makes sense to enforce any kind of 
coding standard.

- Jonathan M Davis


More information about the Digitalmars-d mailing list