[FFmpeg-cvslog] r19695 - trunk/libavcodec/twinvq.c
Michael Niedermayer
michaelni
Wed Sep 2 14:31:09 CEST 2009
On Wed, Sep 02, 2009 at 11:19:58AM +0200, Diego Biurrun wrote:
> On Fri, Aug 28, 2009 at 01:11:53PM +0200, Michael Niedermayer wrote:
> > On Tue, Aug 25, 2009 at 10:50:50AM +0200, Diego Biurrun wrote:
> > > On Tue, Aug 25, 2009 at 04:16:37AM +0200, Vitor Sessak wrote:
> > > > Diego Biurrun wrote:
> > [...]
> > > > >>--- trunk/libavcodec/twinvq.c Mon Aug 24 15:43:33 2009 (r19694)
> > > > >>+++ trunk/libavcodec/twinvq.c Mon Aug 24 19:35:47 2009 (r19695)
> > > > >>@@ -458,7 +458,7 @@ static void add_peak(int period, int wid
> > > > >>
> > > > >>- for (j=-width/2; j < (width+1)/2 && shape < shape_end; j++)
> > > > >>+ for (j=-width/2; j < (width + 1)/2 && shape < shape_end; j++)
> > > > >
> > > > >There are still some operators on this line that could benefit from
> > > > >whitespace, especially / and =.
> > > >
> > > > I try to stick to K&R for most of the things but it goes a little too
> > > > far on extra whitespaces for my taste. I particularly hate doing
> > > >
> > > > for (i = 0; i < 10; i++)
> > > >
> > > > instead of
> > > >
> > > > for (i=0; i < 10; i++)
> > >
> > > That's the good thing about common styles: Nobody gets to be the
> > > privileged person whose style gets picked. Everybody has to adapt.
> >
> > There is nothing good on "Everybody has to adapt"
>
> You misunderstand. It is much better to make everybody get used to a
> common style instead of picking favorites and declaring that everybody
> has to adopt the style used by one person like you or me or whomever.
You misunderstand as well, i did not suggest that anyone should adapt
to the finest fineprint of any style, there just is no reasonable relation
between work and gain in terms of readability at that level.
Also the style choosen as reference should be what most people like, in
the sense of asking everyone, aka a vote ...
What you do is that you pick the style (K&R) not to mention that this
is not a clear definition, is it the indent output, the style used in
their book, the indent output of course can also change beteen versions.
And iam not sure if the book really is consistent at the level of
fineprint that is being used here. Not to mention the consistency acorss
projects you seem to want cant really be achived by starting out with an
unclear definition like "K&R", they used the style, they did not define
it AFAIK
And above all, theres the quote from K&R
"The position of braces is less important, although people hold passionate
beliefs. We have choosen one of several styles. Pick a style that suits you,
then use it consistently."
Here they say even the most major style features should be choosen as people
prefer.
>
> > If it where we could go the full way to gnu style, for that people would
> > have to adapt alot more and fight their better judgement also alot more.
>
> That's why we are using a common style that has sensible defaults: K&R.
> It's also one of or even the most commonly used style, so people have to
> adapt less.
K&R is popular, but thats the brace placement, i dont think that many follow
all the space here and there rules of the unix indent program
outside the linux FOSS world surely not as they dont even know that program.
Also id assume projects following the K&R indent program style likely have
a rule to actually run the indent program over the code. I very much doubt
many apply such nitpickery on space placement as you seem to suggest.
>
> > > Rest assured that there are parts of K&R I dislike as well. But it's no
> > > use complaining. After a while you adapt and don't consider it
> > > obnoxious anymore. Tastes *are* malleable.
> >
> > But dislike is an indication that there are problems, and
> > i claim ommiting the spaces around * / is more readable. Also in
> > mathematics with pencil and paper there are no spaces around * and / and
> > actually * is not written at all its
> > A = 4ab + cd
> > not
> > A = 4 * a * b + c * d
> > And i think there is little question which is more readable and convenient
> > 4ab is a more "strongly" bound unit than 4ab + cd so it makes sense to also
> > use spaces differently
>
> In math it is clear because numbers and letters are different
> namespaces. In C both are just parts of a string.
well, so its
A = 4*a*b + c*d
vs.
A = 4 * a * b + c * d
the first still is much more readable
>
> With pencil and paper you do put space around / and/or make it exceed
> the height of the letters.
i dont
> Mostly you write fractions, then it's
> absolutely clear.
yes one writes
a
-
b
not
a
-
b
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20090902/2e18c863/attachment.pgp>
More information about the ffmpeg-cvslog
mailing list