[MPlayer-dev-eng] Indentation style (was: [PATCH] Fix useless dependencies in the stream lib)

Alban Bedel albeu at free.fr
Tue Apr 8 23:37:08 CEST 2008


On Tue, 08 Apr 2008 23:11:02 +0300
Uoti Urpala <uoti.urpala at pp1.inet.fi> wrote:

> On Tue, 2008-04-08 at 21:31 +0200, Alban Bedel wrote:
> > We don't really need everybody to agree. If some maintainer hate
> > tags for some reason he is free to forbid them in the files he
> > maintain. For files without maintainer obviously we will need some
> > consensus, but I doubt that debating adding a few comments would be
> > as inflammatory as breaking a long established tradition.
> 
> I think letting "the maintainer" decide on use of non-standard tags
> is a major problem with your proposal. The maintainer list often does
> not reflect who in practice works on the files; and IMO we do not
> want the bureaucracy to maintain a really authoritative list. In
> practice there is rarely only a single person who would work on a
> file. We'd need a better way to decide how to set the tags if there
> is any disagreement. And overall I think trying to set authority over
> code on a per-file basis is a bad idea.

Maintainer was meant in the broadest possible sense. You are making
things a lot more complex than they need to be. Tags should obviously
be handled just like the rest of the code in the file.

> If some file which uses non-standard formatting (especially other
> than 4 space indent) gets many edits with 4-space indent then is
> setting tags really the right answer? IMO it's questionable whether
> it would be reasonable to set nonstandard tags, as obviously more
> people than the original author need to work on it. Maybe reindenting
> it to follow a common style would be a better choice.

Obviously tags can't be applied to files with mixed indentation. If
and how we reindent files needing it is a different topic.
IMHO files with just a few inconsistent part should be fixed to follow
the rest and wild mixture should use an agreed style (I don't care
which as long as there is tags ;)

> One example of a file which IMO should not require using nonstandard
> style for edits is m_option.c. You originally wrote that file, but
> working on options related to other code can easily require changes to
> it, and it should not be considered anyone's "own" file.

This is again unrelated to the fact that files are tagged or not. Tags
are only useful for files with a consistent indenting to help keeping
it consistent. You are still free to reindent it (and accordingly
update the tags ;) if you want/need to.

> > > > The only downside I can see is that it would give lees reasons
> > > > to have a common style ;)
> > > 
> > > That's a good reason, why reduce the pain threshold? ;-)
> > 
> > IMHO if we start tagging some files, it would probably give some
> > more insensitive to clean files with mixed indentation. Which after
> > all might be a good occasion to try getting them to use your common
> > style ;)
> 
> That there are files with mixed style shows that in practice many
> files will be worked on by several people, at the same time or at
> different times. Allowing the first person to work on the file to set
> nonstandard tags and making such a style even more "official" for the
> file would have a negative effect. Changing style every few lines is
> a readability problem, but for example having some functions in a
> different style is much less so IMO. So I think that at least adding
> a new function in a common style should be OK even if the rest of the
> file uses some weird style - adding more code in a weird style even
> if the only person who likes that style isn't currently working on
> the code is a problem too.

And who decide what "a weird style" is? What you seems to miss is that
every file in the tree started with a consistent indentation. Then ppl
used editors with widely different settings and messed up things; in
some places beyond recognition. The problem is not that we have devs
using aberrant styles, it's the mixture of badly configured editors.

Personally I don't give a damn about any pet indentation style, all I
want is readable code and not having to mess with indentation and
tab-expansion settings every time I open a file.

	Albeu




More information about the MPlayer-dev-eng mailing list