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">&lt;<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>&gt;</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>
&lt;<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>&gt; wrote:<br>
&gt;&gt; (setq-default c-basic-offset 4<br>
&gt;&gt;           tab-width 4<br>
&gt;&gt;           indent-tabs-mode nil)<br>
&gt;&gt; (c-set-offset &#39;case-label &#39;+)<br>
&gt;<br>
&gt; Not sure if it is RFC material, but you can definitely share it in<br>
&gt; <a href="http://trac.osgeo.org/gdal/wiki/HowToContribute" target="_blank">http://trac.osgeo.org/gdal/wiki/HowToContribute</a><br>
&gt;<br>
&gt; 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>
&gt; You have also probably noticed the nice visual ascii art that is generally<br>
&gt; prepended before each function/method :<br>
&gt;<br>
&gt; /************************************************************************/<br>
&gt; /*                               foo()                                  */<br>
&gt; /************************************************************************/<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>
&gt; And if you really want to confuse FrankW and make him believe he has written<br>
&gt; the code himself, you&#39;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 &quot;if (foo)&quot; 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>