4 spaces makes sense. Tabs would be a mistake and misconfigured IDE.<div>I have heard that for &quot;dense&quot; languages - people like 2 space indents (its recommended in scala - which I spend most of my time). </div><div>
<br></div><div>But I think DRL would look a bit funny with 2 spaces - 4 does make sense, as DRL lines aren&#39;t very long - they don&#39;t need to be !</div><div><br></div><div>Nice work picking this up geoffrey - and yes, in the past I was bitten by merge hassles.<br>
<br><div class="gmail_quote">On Tue, Sep 7, 2010 at 2:36 AM, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
  yes it should be 4 spaces.<br>
<font color="#888888"><br>
Mark<br>
</font><div><div></div><div class="h5">On 06/09/2010 14:20, Geoffrey De Smet wrote:<br>
&gt; Hi guys,<br>
&gt;<br>
&gt; Looks like we have different ways of indent our files.<br>
&gt; I &#39;ve seen these occurrences for a single indentation on drools trunk:<br>
&gt; - java files:<br>
&gt; -- 4 spaces<br>
&gt; -- 1 tab<br>
&gt; - xml files:<br>
&gt; -- 4 spaces<br>
&gt; -- 3 spaces<br>
&gt; -- 2 spaces<br>
&gt; -- 1 tab<br>
&gt; - drl files:<br>
&gt; -- 4 spaces<br>
&gt; -- 2 spaces<br>
&gt; -- 1 tab<br>
&gt; I&#39;ve seen different types mixed in the same line regularly. One<br>
&gt; developer created the line, another developer wrapped it in an if statement.<br>
&gt;<br>
&gt; The problem<br>
&gt; ===========<br>
&gt; What&#39;s the problem with mixing these different types?<br>
&gt; - It stimulates merge conflicts.<br>
&gt; - It obfuscates diffs.<br>
&gt; - It hampers with readability.<br>
&gt; Some editors show \t as 2 spaces, others as 4, others as 8. Most<br>
&gt; notably, in plain HTML, firefox etc show it as 8 spaces IIRC.<br>
&gt; So line A with 2 indentations of 4 spaces each<br>
&gt; and line B with 2 indentations of 1 tab each<br>
&gt; are not rendered starting from the same column.<br>
&gt;<br>
&gt; The solution proposals<br>
&gt; ======================<br>
&gt; We should agree on what to use.<br>
&gt; Then simply configure it in eclipse/intellij:<br>
&gt; - In eclipse you need to set it several times:<br>
&gt; -- once in the java style (or import the eclipse-formatter.xml)<br>
&gt; -- once in the xml style (even if you import the eclipse-formatter.xml file)<br>
&gt; -- once in the text style (even if you import the eclipse-formatter.xml<br>
&gt; file)<br>
&gt; - In intellij, do it in code style/general.<br>
&gt;<br>
&gt;<br>
&gt; Proposal 1) Use 4 spaces in java, xml and drl to indent.<br>
&gt; Pro:<br>
&gt; - The current drools eclipse formatter, trunk/eclipse-formatter.xml<br>
&gt; states this for java files. Note that it says nothing about xml or drl<br>
&gt; files because those need to be configured separately in eclipse, which<br>
&gt; is probably the reason why some of use spaces for java files and tabs<br>
&gt; for xml files.<br>
&gt; - Most of our java files currently use 4 spaces<br>
&gt; - The &quot;Sun java coding conventions&quot; state we should use 4 spaces.<br>
&gt; <a href="http://www.oracle.com/technetwork/java/codeconventions-136091.html#262" target="_blank">http://www.oracle.com/technetwork/java/codeconventions-136091.html#262</a><br>
&gt; &quot;Four spaces should be used as the unit of indentation.&quot;<br>
&gt;<br>
&gt; Proposal 2) Use 4 spaces in java and 2 spaces in xml and drl<br>
&gt; Pro:<br>
&gt; - xml files can have deep indentations and 2 spaces might be clear enough<br>
&gt;<br>
&gt; Proposal 3) Use 1 tab in java, xml and drl to indent.<br>
&gt; Pro:<br>
&gt; - Eclipse uses 1 tab by default for xml files (and maybe also for java<br>
&gt; files?)<br>
&gt;<br>
&gt; My opinion (vote?)<br>
&gt; ==================<br>
&gt;<br>
&gt; Proposal 1) Use 4 spaces in java, xml and drl to indent.<br>
&gt;<br>
&gt; PS<br>
&gt; ==<br>
&gt; Please keep this topic isolated to the spaces VS tabs problem.<br>
&gt; If you&#39;d like to open the topic of the coding style which differs<br>
&gt; between developers, please do so in a separate topic, as that one can be<br>
&gt; long and unfulfilling discussion and I &#39;d like to settle the spaces<br>
&gt; quickly...<br>
&gt;<br>
<br>
<br>
</div></div><div><div></div><div class="h5">_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Michael D Neale<br>home: <a href="http://www.michaelneale.net">www.michaelneale.net</a><br>blog: <a href="http://michaelneale.blogspot.com">michaelneale.blogspot.com</a><br>

</div>