[Rosettacode] D code line length limit

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed May 7 06:39:55 PDT 2014


On Wednesday, 7 May 2014 at 13:25:55 UTC, bearophile wrote:
> So far in Rosettacode D entries I've kept a line length limit 
> of 72 or 73 chars.
>
> But now a little larger monitors are common, D UFCS chains are 
> common, and we also have longer function signatures with "pure 
> nothrow @safe @nogc" (that usually I put on a new line), so 
> keeping that line length limit is becoming a little pain.
>
> So probably I'll increase the maximum line length. Rosettacode 
> rules forbids too much long lines, and while in my code I use a 
> limit of about 90-100 in my code, this is too much for online 
> wiki pages. So I'll do some tests, and I think for Rosettacode 
> D entries I'll increase the limit to about 80 chars.
>
> Bye,
> bearophile

Maybe D programmers need to adopt a new convention for 
annotations in the long term. Instead of:

void doSomething(int n) pure @safe @nogc nothrow
{
}

We should write:

pure @safe @nogc nothrow
void doSomething(int n)
{
}

The only problem being that this conflicts with the convention 
for UDAs...


More information about the Digitalmars-d-learn mailing list