[MPlayer-dev-eng] Re: [PATCH] Development (Was: Clean

Arpi arpi at thot.banki.hu
Tue Feb 26 08:39:03 CET 2002


Hi,

> > I have an idea. We could suggest a coding style, and then the people
> > who wants to use it can use it. To make it easier we could write
> > config files for the most common editors. I would be happy to use the
> > style Arpi is using cause it reminds me of the dos version of Borland
> > C++ from the time when I started programming :).
strange, i've never used borland c++. but used borland pascal very long time
ago, when i moved to pc from c64...

> 	Wow...I can honestly say that I've never seen anyone get
> sentimental over a coding style...:) Seriously, though, which files are
> representative of A'rpi's coding style? Not being facetious here, I'm just
> curious which ones he originated and have gone largely unchanged.
> 
either check mplayer v0.10, it's 100% my code.
or the old demuxer files, avi|asfheader.c, demux_[mpg_avi|asf], demuxer.c etc
or aviwrite.c, it's quite new and 100% mine :)

anyway, i don't think my style is so special or ugly.
it's just fewer lines style (so i don't write { and } to new lines) and use
short 2/4 indenting. the less welcomed thing i sometimes do is inserting new
if() or {} blocks without moving the inner part right to match indenting...
instead i place new {} between them so old:

if(x){
  for(a,b,c){
  }
}

new:

if(x){
 if(y){
  for(a,b,c){
  }
 }
}

and, at very rare cases, if i have to if() a very big block of code, i just
put if{ and } right at the beginning of the line, to make it well noticable...

about goto and others: i don't agree with people saying goto must be
avoided. sometimes it's good, anyway i don't used to use it. but i'm using
return even in the inner loop of for() if i want.

btw. mplayer was my project and i was the only developer for over half year.
so i felt free to use my coding style instead of grabbing some braindamaged
one from kernel or other projects...
i think that every freetime opensource hacker likes to spend their spare
time coding using their own coding style. why to force them to something?
and as someone said: we will NEVER agree on a single style, everyone thinks
different.

and the main point: what matters is the code efficiently, performance,
stability. what doesn't: indenting...


A'rpi / Astral & ESP-team

--
Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu



More information about the MPlayer-dev-eng mailing list