> -----Original Message-----
From: wine-devel-admin@winehq.com [mailto:wine-devel-admin@winehq.com]On Behalf Of David Laight Sent: Wednesday, November 27, 2002 1:34 AM Cc: wine-devel@winehq.com Subject: Re: Coding standards
Probably vi with autoindent, tabstop=8 and shiftwidth=4
(my preferred indent).
Of course everyone has his own taste and there's nothing
wrong with 8. We
just found that with 8 spaces there's very much indentation
if you have quite
some nested ifs/whiles/fors/whatevers. While still trying
to stay under 80
chars per line (for a nice printing) you don't have much space left to put code on :)
Indeed - printing in one reason you should not set the tab size to anything other than 8.
With vi and sw=4,ts=8,ai you indent with ^T and outdent with ^D. vi adds the correct number of tabs and spaces to end up in the right position.
which is what I hate. This is the worst of both worlds. Either use Tabs throughout so that a tab equals an indent and so people can set the tab size to whatever they like or else don't use tabs at all and use explicit spaces. (The usual argument for using tabs relates to the fact that they line up with proportionally spaced fonts but I don't think that worries us does it; I almost always use a fixed font for code display). I would argue in favour of using tabs for indent if it were not for the fact that we already have an enormous amount of code that doesn't and I doubt if we would refuse code that didn't.
8 char indents (as used by netbsd) to tend to leave you trying to pretify code in about 16 colums sometimes. Made more likely if your style involves 2 indents for a switch statement, eg: switch (...) { case ...: break;
David
-- David Laight: david@l8s.co.uk
Bill Medland
On November 27, 2002 12:45 pm, Medland, Bill wrote:
which is what I hate. This is the worst of both worlds. Either use Tabs throughout so that a tab equals an indent and so people can set the tab size to whatever they like or else don't use tabs at all and use explicit spaces.
And what's so bad about mixing spaces and tabs? Using only tabs is (1) hard/impossible to enforce, and (2) still suffers from deviation from the standard. It maybe workable in a company, but not on the internet.
On the other hand, what's the big deal with mixing tabs and spaces? What's the big loss as compared to only spaces? This is just trying to impose (silly) policy on people. As long as we stick to the standard meaning of tab (which is 8, there's no question about it. What do you get when you send a file to the printer? Or open it in a non-customized editor?), there is no need whatsoever to force people into this or that way. And this without a loss for anyone!
Why do people feel a need to force others into certain way of doing things, when the end result is the same?!? This is like forcing people to QWERTY instead of DVORAK... I'm not against standards, I would actually like if we had more uniform looking code, but this is really unnecessary, as it serves no purpose.
"Dimitrie O. Paun" dpaun@rogers.com writes:
On the other hand, what's the big deal with mixing tabs and spaces? What's the big loss as compared to only spaces? This is just trying to impose (silly) policy on people. As long as we stick to the standard meaning of tab (which is 8, there's no question about it. What do you get when you send a file to the printer? Or open it in a non-customized editor?), there is no need whatsoever to force people into this or that way. And this without a loss for anyone!
There are two problems with tabs: one is that no matter how much we agree that the tab size is 8, some people do change their editor settings and that messes up the code; the other is that it makes diffs harder to read because things don't line up properly due to the extra char in the first column. It's much better to only use spaces (but I'm of course not going to try to enforce that).
On November 27, 2002 04:30 pm, Alexandre Julliard wrote:
There are two problems with tabs: one is that no matter how much we agree that the tab size is 8, some people do change their editor settings and that messes up the code;
Don't get me started! :))) But thinking about it, there is good value in have the code messed up: it tells the user that their editor has an incorrect tab value. Otherwise, they can happily edit the file with a tab setting of 3, insert some tabs, and submit that.
the other is that it makes diffs harder to read because things don't line up properly due to the extra char in the first column. It's much better to only use spaces (but I'm of course not going to try to enforce that).
I realized that afterwards. In fact, in a private email I mentioned exactly this problem. I agree that it's better to use only spaces for these reasons, but in all honesty, I don't really care as long as I am not forced to define a special value for tab. <g>