Coding style

Benedikt Meurer Benedikt.Meurer at unix-ag.uni-siegen.de
Fri Mar 14 14:35:13 CET 2003


On Fri, 14, Mar 2003, Jasper Huijsmans wrote:

> On Fri, 14 Mar 2003 14:24:02 +0100
> Benedikt Meurer <Benedikt.Meurer at unix-ag.uni-siegen.de> wrote:
> 
> > Hello all,
> > 
> > I think its time to standardize on a common coding style. Just to make
> > sure, everyone gets the point:
> > 
> > 	* Use glib functions where possible
> > 	* Prefer g_strdup_* over snprintf() and friends (maybe a
> > 	question
> > 	  of context)
> > 	* Editor settings: sw=4 ts=4 et (this is what jasper and olivier
> > 	  seems to be using)
> > 
> 
> ts=8

Hm, thats bad. Either ts=8 and sw=8 or ts=4 and sw=4. Do not mix them.

> And block opening curly braces on new line (you have changed that in
> certain places), so
> 
> if ()
> {
> }
> else
> {
> }
> 
> instead of
> 
> if () {
> } else {
> }

Yeah, I used to use KNF (Kernel normal form). Its better to read and its
easily visible.

BTW its:

if () {
}
else {
}

> There's a .indent.pro file in xfwm4/src/ that should be used for the
> coding style.

hm, i´d vote for a more common and a better readable coding style than
the current one in use. But if all others agree on the current style,
I'm going to adept that style (except that sw and ts should be equal
in any case!).

regards,
Benedikt

-- 
Those who do not understand Unix are condemned to reinvent it, poorly.
    -- Henry Spencer



More information about the Xfce4-dev mailing list