[gdal-dev] emacs configuration for correct code indentation?

Frank Warmerdam warmerdam at pobox.com
Fri Sep 2 15:26:57 EDT 2011


On Fri, Sep 2, 2011 at 12:06 PM, Etienne Tourigny
<etiennesky.dev at gmail.com> wrote:
> Frank, please do send me your emacs macros.   With your permission I will
> add that information to the wiki as suggested by Even.

Etienne,

I have added a note to myself to collect the header macro
tonight.  It is a bit involved, and written by someone else
when I was at PCI so it is not trivial.

> I agree with your policy of not being too strict, but a minimal set of
> standards is a good thing IMHO.
> It could help in elaborating a suggested standard in the wiki page (just my
> 2 cents).
> Two issues that come to mind are
> 1) where to put opening braces in if/else/for blocks  It can get a little
> messy, as different flavors are used by different people
> if ( 1 ) {
> ...
> }
> vs
> if ( 1 )
> {
> ...
> }
> 2) one-liner if/else statements without braces.  Some projects like qgis
> discourage their use, but personally I like it more compact

These are both examples of style issues I would not choose to
take a position on.  They don't materially affect readability
of code (IMHO) and a mixture of approaches to the above is
not harmful.  So I'd rather just say nothing.

Indentation issues on the other hand can render code
very hard to read (ie. using tabs with a mixture of 4
or 8 indent assumptions).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Software Developer


More information about the gdal-dev mailing list