From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2002-09-09 18:30:02
>From: "William E. Kempf" <williamkempf_at_[hidden]>
>From: "Terje Slettebø" <tslettebo_at_[hidden]>
>> Note that the arguments in the article against tabs (alignment problems)
>>are fixed by using spaces for alignment, and you _still_ get the tab size
>Mixing tabs (for indentation) and spaces (for alignment) doesn't work in
><tab>if (foo)<sp><sp><sp>// If foo is true
><tab><tab>bar();<sp>// then call bar
>If <tab>s are specified as 4 spaces in your editor then these comments
>correctly, but if the <tab> is another size (like 3) it likely won't.
>Alignments on lines that are indented the same work, but if the alignment
>must span lines that have differring indentations (which isn't that
>uncommon) then use of tabs causes problems here.
This was also addressed in the article that John Levon posted a link to.
Yes, in this case, the comments won't align correctly. That's a consequence
of being able to set any tab size.
>There's pros and cons in both directions. I think spaces are a better
>answer, but in any event, historical reasons indicate we aren't likely to
>change now unless there's a clear winner in the decision to switch to tabs,
>which there won't be.
For your own projects, you may use whatever you want. And for cooperative
projects, tabs/spaces is just one of many elements that may differ from
preference to preference. As I said in another posting, you tend to learn to
adapt. So I've written in all kinds of styles, adapting to the existing
convention, so that it would fit with the rest of the code.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk