Re: Self Help (1)



On Tue, 2001-08-07 at 15:09:35, Michael Meeks wrote:

> * A lesson in taste
> 
>         By extensive experimentation, and careful measuring of code
> quality across millions of lines of code, it has been conclusively
> discovered that 2, 3 or 4 stop indents are the devil's tool ? tabs are
> 8 stops, so are indents.
> 
> cf. /usr/doc/linux/Documentation/CodingStyle - chapter 1.

Yes, that's true for the Linux kernel sources. All identifiers in the kernel
are very short. Identifiers in GNOME programs/libraries are getting longer
and longer every day.
With long identifiers using smaller indents really makes sense - it allows
you to see more code on your screen (you can see what I'm talking about by
reading nautilus sources on 80x25 terminal :-).

Besides, _assuming_ that tabs are 8 characters is always a bad thing...

The following example demonstrates _typical_ formatting in GNOME program.
It looks good only if tab == 8 spaces and it's... tasteless :-)
(I'm using dots instead of spaces here)

<tab>do_something (here_is_the_first_argument_taking_a_lot_of_space,
<tab><tab>......here_is_the_second_argument);

And here's properly formatted example - it's fully tabsize-independent:

<tab>do_something (here_is_the_first_argument_taking_a_lot_of_space,
<tab>..............here_is_the_second_argument);


If you don't like my arguments then think about freedom. The freedom of
using any tab setting you want and still be able to hack on GNOME :-)


Summary:
Don't use tabs for "space compression". Use tabs for indentation.


Zbigniew




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]