4 spaces makes sense. Tabs would be a mistake and misconfigured IDE.<div>I have heard that for "dense" 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't very long - they don'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"><<a href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>></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>
> Hi guys,<br>
><br>
> Looks like we have different ways of indent our files.<br>
> I 've seen these occurrences for a single indentation on drools trunk:<br>
> - java files:<br>
> -- 4 spaces<br>
> -- 1 tab<br>
> - xml files:<br>
> -- 4 spaces<br>
> -- 3 spaces<br>
> -- 2 spaces<br>
> -- 1 tab<br>
> - drl files:<br>
> -- 4 spaces<br>
> -- 2 spaces<br>
> -- 1 tab<br>
> I've seen different types mixed in the same line regularly. One<br>
> developer created the line, another developer wrapped it in an if statement.<br>
><br>
> The problem<br>
> ===========<br>
> What's the problem with mixing these different types?<br>
> - It stimulates merge conflicts.<br>
> - It obfuscates diffs.<br>
> - It hampers with readability.<br>
> Some editors show \t as 2 spaces, others as 4, others as 8. Most<br>
> notably, in plain HTML, firefox etc show it as 8 spaces IIRC.<br>
> So line A with 2 indentations of 4 spaces each<br>
> and line B with 2 indentations of 1 tab each<br>
> are not rendered starting from the same column.<br>
><br>
> The solution proposals<br>
> ======================<br>
> We should agree on what to use.<br>
> Then simply configure it in eclipse/intellij:<br>
> - In eclipse you need to set it several times:<br>
> -- once in the java style (or import the eclipse-formatter.xml)<br>
> -- once in the xml style (even if you import the eclipse-formatter.xml file)<br>
> -- once in the text style (even if you import the eclipse-formatter.xml<br>
> file)<br>
> - In intellij, do it in code style/general.<br>
><br>
><br>
> Proposal 1) Use 4 spaces in java, xml and drl to indent.<br>
> Pro:<br>
> - The current drools eclipse formatter, trunk/eclipse-formatter.xml<br>
> states this for java files. Note that it says nothing about xml or drl<br>
> files because those need to be configured separately in eclipse, which<br>
> is probably the reason why some of use spaces for java files and tabs<br>
> for xml files.<br>
> - Most of our java files currently use 4 spaces<br>
> - The "Sun java coding conventions" state we should use 4 spaces.<br>
> <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>
> "Four spaces should be used as the unit of indentation."<br>
><br>
> Proposal 2) Use 4 spaces in java and 2 spaces in xml and drl<br>
> Pro:<br>
> - xml files can have deep indentations and 2 spaces might be clear enough<br>
><br>
> Proposal 3) Use 1 tab in java, xml and drl to indent.<br>
> Pro:<br>
> - Eclipse uses 1 tab by default for xml files (and maybe also for java<br>
> files?)<br>
><br>
> My opinion (vote?)<br>
> ==================<br>
><br>
> Proposal 1) Use 4 spaces in java, xml and drl to indent.<br>
><br>
> PS<br>
> ==<br>
> Please keep this topic isolated to the spaces VS tabs problem.<br>
> If you'd like to open the topic of the coding style which differs<br>
> between developers, please do so in a separate topic, as that one can be<br>
> long and unfulfilling discussion and I 'd like to settle the spaces<br>
> quickly...<br>
><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>