indent style for D

Marco Leise Marco.Leise at gmx.de
Sun Jan 29 11:26:18 PST 2012


Am 29.01.2012, 16:23 Uhr, schrieb Trass3r <un at known.com>:

>> Am I mistaken? If no, am I missing some major spaces advantages? If no,  
>> lets use tabs. Perhaps, there is no tool that will convert (convert  
>> right, not somehow, see article) tabs<->spaces in D code.
>
> There wouldn't be any problem if people were able to use tabs for  
> indentation and spaces for alignment, i.e. in cases like
> if (cond1 &&
>     cond2)
>
> But people are dumb and many project leaders "take no risks" and require  
> spaces everywhere instead of doing it properly.

If it cheers you up, I use that style. Once you get used to 'smart tabs'  
it is like using spaces. Just now and then I catch myself using tabs on  
the alignment for local variable comments:

	int foo;		// does something (tabs)
	int bar;        // something else (spaces)

Then again "tabs for indentation only" is a simple rule, that would have  
turned the tabs into spaces in this example - if editors supported it.


More information about the Digitalmars-d mailing list