geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Blewitt <Alex.Blew...@ioshq.com>
Subject Re: XML indent?
Date Tue, 12 Aug 2003 23:31:25 GMT
On Tuesday, Aug 12, 2003, at 23:01 Europe/London, Dain Sundstrom wrote:

> On Tuesday, August 12, 2003, at 08:11 AM, Alex Blewitt wrote:
>
>>> http://nagoya.apache.org/wiki/apachewiki.cgi?ApacheJ2EE/ 
>>> CodingStandards
>>>
>>> have updated the wiki - how about we go for the 2 characters indent  
>>> which is quite common?
>>
>> Why the discrepancy between indenting Java code with 4 characters,  
>> and XML with 2? Why not be consistent?
>>
>> IMHO I'd prefer 2 for both, but that's my personal preference.
>>
>> If you're using Eclipse (for example) then you can configure it to  
>> insert X spaces when you hit the tab key. Trying to implement it so  
>> that it uses 4 with .java files and 2 with .xml files is a  
>> non-trivial task.
>
> +1 for 4 spaces
>
> Idea (IntelliJ) has the same issue... Also the common reason I hear  
> for having smaller indents in XML is because of the deep indentation,  
> but to me that is trying to cure the sympotom and not the real problem  
> of a badly designed schema.

OTOH using 2 spaces for XML and Java would also introduce the common  
indenting convention, and allows much more space to be used on a line.  
I've often wondered why people go with >2 spaces, since there's a  
difference between 'one space' and 'multiple spaces', but the exact  
number of the multiple has always seemed to end up right-shifting  
indented code ...

Me, I'd go for 2 spaces but I suspect that 4 may be the more popular  
choice.

Alex.


Mime
View raw message