[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Source Code Formatting Standard Update
From: |
jyqvklioo |
Subject: |
Re: Source Code Formatting Standard Update |
Date: |
Wed, 16 Sep 2009 15:33:31 +0200 |
User-agent: |
KMail/1.11.4 (Linux/2.6.30-1-686; KDE/4.2.4; i686; ; ) |
>> The increased consistency will also make it possible to have simpler
>> implementations of automatic formatting software.
>I'm not sure what you mean,
>the requirement is only for function bodies, (...).
I mean to make the requirement for function bodies the same as for other
blocks.
To make example code with a loop:
void
functionName()
{
for(unsigned i=0;i<4;i++)
{
doMe(pretendItWrapped here,
andCode continued);
}
}
Each parethesis, brace, or bracket can mean the same increase of indentation
level. Each { indicates a new block and sub-namespace.
For me this is more logical and understandable. I expect it is otherwise for
some people. Being accustomed to a certain practice is usual.
>GNU indent does the right thing by default when it comes to the GNU
>coding standards.
I tried 2 standalone programs previously. 1 of which was "GNU indent". 1 did
not run on a non-unix platform, which at the time was a requirement, but may
not
be for other projects. The other was unreliable.
With the alterations I proposed, a hard coded formatter could be simple,
speedy,
and reliable: a combination I have not seen despite searching. Even if there
were software available, there could be lighter weight, simpler software to
implement the formatting if each parethesis, brace, or bracket resulted in the
same increase of indentation level.