[XviD-devel] Re: What are the most important optimization opportunities?

Felix von Leitner xvid-devel@xvid.org
Sun, 19 Jan 2003 20:34:34 +0100


Thus spake Edouard Gomez (ed.gomez@free.fr):
> > > Attached is a small trivial diff that I noticed.  The #if 0 part in the
> > > end is to make the vim editor use the proper tab stops.  I would prefer
> > > if xvid used standard 8-width tab stops, though, but that's not my
> > > decision to make.
> We decided to use 4 for tabs because there are some code pathes that are
> too much indented with 8 spaces tabs.

I'm not saying you should simply switch to 8 spaces.  Obviously, it
would look really broken then, especially regarding the ascii art
tables.

I'm saying you should reformat the source code so that it looks like it
looks now with tab stops set to 8.  It is easy to do it with most decent
editors and I think there even exist good tools for it.  This way you
are driving developers away who open the source code in their editor for
the first time and then refuse to help with a project where the source
code looks so hideously broken.  I'm not making this up, this has
happened before to other projects.  And all programmers' editors can
transparently change tabs to spaces to keep up appearances.

But I can understand if you don't want to do that for historical reasons
or because of inertia ;)

> Anyway, we won't include any editor trick into sources because we would
> have most editor directives than code in files.

Which editors besides vim and emacs even understand directives like
this?

> I described a tip  to edit C/H files with emacs using  the right C style
> in the CodingStyle file. This tip  is based on the file path, when emacs
> opens  a file in  a path  matching the  regexp /.*/xvidcore.*/.*\\.[ch]$
> then it activates the xvid-c-mode. 

I think it's unreasonable to expect developers who just casually want to
browse the source code to customize their editor.  Just try running less
on one of the files with tables in the comments and you will see.

> If a similar tip  exists for Vim, i'll be happy to  add it to the Coding
> style file.

It would be something like

  autocmd BufRead xvidcore*/*.[ch] set ts=4

but that only works if you specify the full path when opening the file,
which nobody does.  The vi way is to have a file called .exrc in the
current directory which overrides this setting, and the vim way is to
include a comment in the end.  There really is no other way to do it.

> @gruel: linux sources specify a tab is 8 spaces long iirc. See
>         CodingStyle

That's not just what the linux source say.  It's the standard on all
unix systems.  I think it's not acceptable that you can't less or cat a
source code file and read it properly this way.

I'm curious: does this coding style originate from opendivx or was it
converted by the xvid project?

Felix