[MPlayer-dev-eng] Offer of help to get me started

Evil Kosh evil_kosh_uk at yahoo.co.uk
Mon Mar 24 02:21:08 CET 2003


On Mon, 2003-03-24 at 00:47, D Richard Felker III wrote:
> On Mon, Mar 24, 2003 at 12:11:40AM +0000, Evil Kosh wrote:
> > Hello Rich,
> > 
> > no, I'm not trolling the list, I'm serious.  IMHO I started to read the
> 
> Sorry then. With a name like "Evil" you had me a bit suspicious.

It's ok, with a name like Evil I get a lot of people asking that same
question.

> > source and found that people were using spaces here, tabs there,
> > sometimes the brace would be after the if/switch/for statement on the
> > same line, others would have it below, others wouldnt have one at all.
> 
> And all are perfectly readable if you're remotely competent with C.

yes, it's readable, but mostly by the people who wrote it.  If you are
new to the codebase, it just looks like (in some places) a big jumble of
code which has no "style".  Even a newbie at C understands that a big
source code base can become harder to maintain and attract newcomers who
may be able to help, when the code is written by certain people, for
those certain people.  I am not trying to tell people here their code
sucks, or their style sucks.  I am merely suggesting that the people
involved get a good sense for what they think is good style and write
code in that style.  If not for the newbies who want to help, but for
themselves who could then read other parts of the code they may in the
past have kept away from because they dont understand it.  Now they are
in a position where the only thing they have to "decode" is the code
itself and not it's formatting too.  By eliminating the process of
decoding the formatting of the code, you can concentrate on actually
reading it.

I suppose what I'm essentially saying here, is that everyone can read
the alphabet, but it only becomes legible or useful, when those letters
are put together in a structured, well understood manner.  a jumble of
letters according to each developer how they like it, is harder to
read.  Even if the end decoded product makes sense to people.

> And if you're not competent with C you should not be writing code
> since it will be full of bugs.
> 
> > like I've said, the linux kernel has a style guide and it helps
> > enormously.  People can read it, produce code according to it and
> > submit, there are no issues with style or hacking, everyone knows what
> > to expect and what the official line is.
> 
> That's nice. I agree totally with Linux's style and use it myself, but
> I disagree totally with trying to reformat everyone's code to meet
> some arbitrary standard like that.

well this is what I find hard to understand.  You agree with linux's
style, yet you dont think it's right that the code should undergo a
reformat to meet an agreed style.  At one point, the linux code
underwent this change too and like you said, you totally agreed with
it.  I understand that it's not nice someone coming in like this and
saying "hey guys, all that code you wrote, I'd like to reformat it
please" but I'm not trying to impose MY style on YOU, I'm suggesting a
base where I can start from, using my experience and some of the style
guide that I read from the linux kernel (most I already used myself
anyway) and then allowing people (like yourself) to make changes to MY
base to make it more acceptable to YOU until everyone involved in making
the style guide has a say and is mostly happy with the style agreed
upon.

please dont think I am saying my style guide is superior to yours.  I
would like nothing more to than have opened the source and found it all
in ONE style, but it's not, what I'm saying, is "hey, guys, can we all
agree on ONE style, I'll do the dogsbody work and you only have to
discuss it"

> > It's like taking the personal touch away from code and trying to be
> > professional about it, without trying to say you are not being
> > unprofessional.  If everyone is allowed to just hack what they like,
> > they will do so and eventually the code is spaghetti.
> 
> That has nothing to do with formatting style. And personally I have no
> wish to be 'professional' if it means behaving like some idiotic
> proprietary software house with all their coding rules, metrics,
> reviews, etc. crap.

actually it has EVERYTHING to do with formatting style, your personal
touch IS your formatting style.  essentially everyone starts with their
own style, it usually comes from reading other peoples code, or someone
they learned from, over time, they learn new styles, or read them and
adapt the best they like until they have their own personal formatting
style.

as for the professional part of what I said.  I'm more talking about
coding in a professional frame of mind, as opposed to coding in a
professional manner.  What I mean by that is that you, for the good of
the dev team, agree on a style by which everyone understands and
implements.  You eliminate the aspect of reading the code whereby you
have to decode the style first, then only can you understand the code. 
Of course any competent C coder can do this, but why should they? just
to be leet?

> > I am offering to update the code with a style, which can then be updated
> > by you guys too which will give us all what we want.  It doesnt cost you
> > anything does it?
> 
> Yes, it costs flexibility and pollutes the cvs logs. Read the archives
> for past discussions of this. It's much more complicated than you'd
> think at first.

i dont think it costs flexibility at all.  If by what you mean it tells
people to code in a certain way, instead of any old fashion then yeah, I
guess it does.  But when projects get bigger and bigger, you have to
lose flexibility in a tradeoff with comprehension.

I may misunderstand this, how much more complicated can it get?  It's
not complicated at all to me.  There are 10+ people developing mplayer
all using different styles to code and the code as a result is hard to
read.  I'm offering to solve that and all it takes is for people to put
away their hacker spirit for a second and talk about it.  I know people
here must be reading this thinking "oh man, you mean I have to change my
style, f**k that".  But as competent C coders you are all capable of
logical, reasoned thought.  A single style for the whole mplayer
codebase would make the code easier to read for new people and eliminate
a entire decode layer in comprehending the code.  How can that be a bad
thing?

> > It helps people like me, who want to help, but find the code hard to
> > read and eventually give up.  By doing this, I can help, improve the
> > quality of the code layout and possibly could help more people to
> > contrbute by removing this (invisible)barrier.
> >
> > I'm not trying to be a bastard, or start fights, I'm simply trying to
> > help in a way that I can.
> 
> If you want to *help* with the project, then write useful code that
> does something. Reformatting to try to 'beautify' the source is not
> coding, it's just a huge waste of time. Like Arpi has said, there are
> programs that can do that for you. If you are simply unable to read
> the source as it is (most likely this means you have a broken text
> editor with tabwidth!=8), then reformat your local copy with the
> indent program while working on it.

reformatting the code is what I think the source needs.  I'd like to
therefore ask people to think about it and when I post my updated
mplayer.c you can judge for yourself.  you may see this as a waste of
time, but whose time is being wasted? mine.  I think it needs doing,
it's my time, let me waste it.  Please dont disagree with me on this
just to stop me wasting my time.

Arpi is right, there are programs which can reformat code, but you
usually have to do it on new incoming code and they dont tend to work
well with massive codebases like mplayer.  There are parts of the
codebase which I dont think automated programs like indent would be able
to reformat.  

What should have happened is that mplayer should have had a style guide
from the beginning really.  Arpi obviously didnt think of it because it
was only him doing the work, but as everyone can now see, as the
codebase has grown enormously, a style is starting to become needed
(just like what happened with the linux kernel, when it started to
attract more people, all coding in _their_ style, they had to form a
style guide to keep people in check and to stop people from polluting a
good source base with badly formatted, illegible code, not that I'm
saying mplayer has any).  Perhaps you dont see it because you've worked
with the code for so long, but from my point of view, the code is hard
to read, understand and break into.  I want to correct that and you have
everything to gain and only a small amount of your personal coding style
will be sacrificed.  It's not a big price to pay, but I think it would
help and I'm offering it.

> Rich
> 
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
-- 
Evil Kosh <evil_kosh_uk at yahoo.co.uk>



More information about the MPlayer-dev-eng mailing list