Basic coding style

Simen kjaeraas simen.kjaras at gmail.com
Tue Nov 23 05:20:30 PST 2010


bearophile <bearophileHUGS at lycos.com> wrote:

> From what I'm seeing in D.learn there is a problem in the D community:  
> some people seem irrationally attached to the idea they are free to  
> write D code as they like. I have four or five times tried to explain  
> why coding standards are important for the development of the D  
> community, but it seems not everybody is understanding it.

First off, in your posts on D.learn, you come off as overzealous and
vindicatory, as if you are on a holy crusade for The One True Style™.
This, I believe, is not a good way to greet newcomers.


That said, I agree there should be a One True Style™, and here are my
suggestions:

Make the style in three parts, where one is considered nigh obligatory,
and concerns public interface only. That is, names and structure.

The second part concerns only official D code. That is, if you want
your code in Phobos, make sure it follows these rules.

The third part should be guidelines to beautiful code. This is a
somewhat subjective measurement, and should be threated as such.


Whenever code is posted on the newsgroup that does not follow part 1,
feel free to suggest that the poster read the style guide. If it does
not follow part 2, leave it alone. If it blatantly violates the
intent of part 3, link to part 3.

-- 
Simen


More information about the Digitalmars-d mailing list