Frank, please do send me your emacs macros. With your permission I will add that information to the wiki as suggested by Even.<div><br></div><div>I agree with your policy of not being too strict, but a minimal set of standards is a good thing IMHO.</div>
<div><div>It could help in elaborating a suggested standard in the wiki page (just my 2 cents).</div></div><div><br></div><div>Two issues that come to mind are </div><div><br></div><div>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</div>
<div><br></div><div>if ( 1 ) {</div><div>...</div><div>}</div><div>vs</div><div>if ( 1 )</div><div>{</div><div>...</div><div>}</div><div><br></div><div>2) one-liner if/else statements without braces. Some projects like qgis discourage their use, but personally I like it more compact</div>
<div><br></div><div><br></div><div>thanks, Etienne<br><br><div class="gmail_quote">On Fri, Sep 2, 2011 at 3:45 PM, Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Fri, Sep 2, 2011 at 11:29 AM, Even Rouault<br>
<<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>> wrote:<br>
>> (setq-default c-basic-offset 4<br>
>> tab-width 4<br>
>> indent-tabs-mode nil)<br>
>> (c-set-offset 'case-label '+)<br>
><br>
> Not sure if it is RFC material, but you can definitely share it in<br>
> <a href="http://trac.osgeo.org/gdal/wiki/HowToContribute" target="_blank">http://trac.osgeo.org/gdal/wiki/HowToContribute</a><br>
><br>
> You have summed up perfectly the most important coding conventions.<br>
<br>
</div>Etienne,<br>
<br>
Agreed, 4 character indent using spaces not<br>
tabs is the key thing to avoid messiness for others.<br>
<div class="im"><br>
> You have also probably noticed the nice visual ascii art that is generally<br>
> prepended before each function/method :<br>
><br>
> /************************************************************************/<br>
> /* foo() */<br>
> /************************************************************************/<br>
<br>
</div>I actually have emacs macros for editing these header blocks.<br>
I could share them if you are interested, but they are not that<br>
critical.<br>
<br>
I deliberately have avoided trying to be really strict about code<br>
formatting in GDAL/OGR. I think over-strictness can be offputting<br>
to new contributors and lead to disputes over details. But do<br>
make an effort to fit into the modules you work on and feel<br>
free to take more liberties on drivers that you are writing from<br>
scratch.<br>
<div class="im"><br>
> And if you really want to confuse FrankW and make him believe he has written<br>
> the code himself, you'd write if( foo ) rather than if (foo) ;-)<br>
<br>
</div>This is one of the details that seems fairly idiosyncratic<br>
to me, but it is contrary to Google code style so perhaps<br>
I will adapt to "if (foo)" now.<br>
<br>
Best regards,<br>
<font color="#888888">--<br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush | Geospatial Software Developer<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br></div>