[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[leafnode-list] Coding Style


some of those of you, particularly Cornelius, may find this posting
offensive or whatever. The rationale behind this is simple: I'm tracking
Cornelius' sources with CVS. Now, if the EXISTENCE of whitespace
differs, patch refuses to merge that beast, and my CVS is not worth a
dime. It does not matter HOW MUCH whitespace there is, but it does
matter IF there is any.

So please consider this:

I encounter a lot of lines like these, just picking one randomly:

xoverutil.c:    close( fd );

What's the rationale behind violating ANY typography rules and put
blanks on the _INSIDE_ of parentheses?  It's not readibility, that
suffers because things are torn apart.

This code would more appropriately be written as:


Next: spacing on if, return etc:

xoverutil.c:    return(helpfindxover( article, 0, xcount-1) );

Apart from the bsearch function that is ANSI standard, return is a
statement, so one better writes:

        return (helpfindxover(article, 0, xcount - 1));

or, omitting one level of excess parentheses:

        return helpfindxovers(article, 0, xcount - 1);

IN CONTRAST: Don't space function parameters from their name:

        if (chdirgroup(de->d_name, FALSE)) { 

is good.

I'm open to discuss most of the issues, but I'm not putting spaces
right inside of (). 

Whether you space the operators, I don't care, just let's agree on
coding style when it comes to whitespace.

If there can be a consensus, may it just be a search and replace of 
([[:space:]]* -> ( 
[[:space:]]*) -> )

and a following indent -i4 -kr run, that's just fine, be it as automatic
as possible to keep the administrator overhead low.

How about you, Cornelius, Stefan Wiens, Jörg Dietrich, being the
maintainer and the most active contributors seemingly?

Matthias Andree

leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list