[GRASS5] Code formatting style

Bernhard Reiter bernhard at intevation.de
Fri Oct 11 15:29:27 EDT 2002


I agree that a common code style is important.

My point was that automatic reformatting has to be followed 
by human inspection. If there is no human inspection I'd not
recommend a massive automatic reformatting.

Thus when you actually do development you can do the reformatting.
Also possible as preprocessing step for automatic clone detection.  :)

We could look into the GNU coding styles...


On Fri, Oct 11, 2002 at 07:06:16PM +0100, Glynn Clements wrote:
> Bernhard Reiter wrote:
> 
> > > 2. run code reformatting software (below is from Apache):
> > >     indent -i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 <files>
> 
> I personally don't care about the exact style chosen, but I
> definitely feel that we should solicit comments first.
> 
> > Does that help much?  The complete file has to be reread and controlled 
> > by a human than. I'd rather not use such a tool.
> > The formatting might be bad, but on the other important information
> > can get lost with the new formatting.
> 
> Yes, it matters. If you are making a change to dozens of files which
> are spread across the entire tree (and I expect to be doing a lot of
> that), you don't want to have to manually change your editor's
> formatting style on every single file.
> 
> Similarly, if you are analysing or eliminating "cloned" code, it's a
> lot easier if you can just use "diff" (which won't work if the two
> instances are formatted differently).
> 
> For any large software project, a single formatting style is
> essential. It really doesn't matter what that style is, so long as its
> the same for every file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20021011/56dfc19f/attachment.bin


More information about the grass-dev mailing list