[sane-devel] mixed tabs+spaces in xerox_mfp source
m. allan noah
kitno455 at gmail.com
Wed Mar 9 11:59:37 UTC 2011
There is a statement somewhere about gnu indenting rules, but AFAIK,
it's never been enforced, because no one really likes it, and it's
just not that important.
My personal opinion: I rather like two space indents, and tabs are 8
spaces wide, so the xerox code looks perfect to me. If you quit trying
to redefine the width of tab stop, your problem goes away.
On Wed, Mar 9, 2011 at 5:46 AM, ABC <abc at telekom.ru> wrote:
> I will 'expand' xerox code if it's SANE standard or even suggestion.
> So I Cc: to sane-devel for feedback, if any.
> 206 backend/*.c files use tab+spaces mixed formatting so it's not
> (And I (and other contributors) should customize my (their) default Vim
> (or other editor) settings to be non-default to disable tabs expansion
> for sane code. So your idea is really just moving hassle from one person
> to another. Imagine for exampel somebody submit patch to me with tabs
> not replaced with spaces. So every patch/edit I should correct tabs.)
> On Wed, Mar 09, 2011 at 10:16:19AM +0000, Warren Turkal wrote:
>> 2011/3/9 ABC <abc at telekom.ru>
>> > On Wed, Mar 09, 2011 at 08:55:26AM +0000, Warren Turkal wrote:
>> > > I use vim. I use a different default tab width.
>> > I use default. I think if you able to costomize Vim to non-defualt
>> > setting, then you are able to resolve consequences. That is just not
>> > problem of the code to support all editors in the world. Editors is for code
>> > (and people) not vice versa.
>> While true. Formatting code in a less visually brittle way can make the code
>> more approachable for developers who do care to change those defaults. I
>> guarantee that I am not the only one to make a change like that.
>> > > I also consider it bad practice to mix tabs and spaces as it just makes the
>> > > code format differently depending on settings on a user's config. While it's
>> > > true that I can somewhat hide the effects with my editor. There is really no
>> > > good reason to mix them. I guess back in the day, folks wanted to be as
>> > > space efficient as possible, but I just don't think that matters as much
>> > > these days.
>> > sane-backends.git/backend$ grep -l "`echo -ne '\t '`" *.c|wc -l
>> > 206
>> > 206 C sources in SANE backends use tab+space mixing. I'm just not going
>> > to start religious war against tab mixing.
>> I don't think there is any religious war when each backend author controls
>> their own code, but it's your playground. I'll play in it as best I can.
>> > > I don't really care whether it's all spaces or all tabs. It's the mixture of
>> > > tabs and spaces that makes the code difficult to read. I tend to lean toward
>> > > all spaces due to the fact that spaces cannot be misinterpreted by editors
>> > > as easily as tabs.
>> > Propose SANE code style standard. :)
>> I don't think that is my place since I am a new developer for SANE. SANE
>> seems to have lots of fiefdoms (e.g. each backend) and I don't think that an
>> external developer could impose some top down rule like that. I only asked
>> you as I felt that the style of the code just made it less approachable for
>> myself, and I have a nagging suspicion that I am not the only one whose ever
>> felt that way about mixed tabs and spaces.
>> > > The primary problem is that with the way the code is currently formatted, I
>> > > (and anyone else) would have to setup my editor to properly view the source
>> > > when using all spaces would allow developers to not be bothered with that. I
>> > > know it seems small, but it really make a project much more enjoyable to
>> > > jump into if I don't have to spend 10 or 15 minutes configuring my editor to
>> > > properly display the code.
>> > When you set up your editor to non-standard tab width you should have
>> > understand consequences. I'm not guilt you can customize Vim.
>> I do it with my eyes wide open. However, I am also not the only person who
>> does it, and I feel that every little bit that makes it easier for a
>> developer to get involved will make it possible to get more contributions to
>> a project.
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> Unsubscribe: Send mail with subject "unsubscribe your_password"
> to sane-devel-request at lists.alioth.debian.org
"The truth is an offense, but not a sin"
More information about the sane-devel