[olsr-dev] code style issues

Hannes Gredler (spam-protected)
Mon Mar 26 12:48:19 CEST 2007


On Mon, Mar 26, 2007 at 12:26:50PM +0200, Bernd Petrovitsch wrote:
| On Mon, 2007-03-26 at 11:04 +0200, Hannes Gredler wrote:
| [...]
| > i have noted that there are several different code-styles
| >   in the repository, which make the tree a bit hard to digest.
| 
| ACK.
| 
| [...]
| >   - little/no use of typedefs.
| 
| Which is IMHO actually a good thing. No need for another layer of
| (syntactic) obfuscation and appending "_type" is IMHO the same effort as
| prepending with
| "struct " .....

well a foo_t (aka POSIX style e.g. u_int8_t) is shorter than a "struct foo";
and i find a e.g. avl_node_t pretty self speaking. i have no hard feelings
here either (its just what i am used to do over here).
 
| [...]
| > what is the right procedure for getting this sorted ?
| > meybe add a short doc 'olsrd_code_style.txt' and
| > convert in peacemeal fashion ?
| > 
| > thoughts ?
| 
| Some months ago I didn't want to break lots of external patches with an
| "indent" run and similar cleanup. But this doesn't hold any more.
| In general this topic is somewhat prone to flamewars since coding style
| is a quite personal thing.

keeping idendation clean is a good thing.
what may help is to teach emacs/vim how to
format code (for those of us who work with the
same editor on several different code-styles).
i.e. adding a

/*
 * Local Variables:
 * c-style: whitesmith
 * c-basic-offset: 2
 * End:
 */

at the trail of each file.

| I'm actually waiting for a result of T. Lopatic promised testing on
| Windows. But I have no problem in releasing 0.5.0 as is and possibly
| 0.5.0.1 if some Win* issues are fixed in a few days/weeks/months.
| And then is probably the best time to deploy a coding-style.txt and
| enforce it immediately (at least in the core parts and for the "indent"
| run + syntactic cleanup. If people maintain plugins mainly outside, e.g.
| Bmf- or the Quagga-plugin, it's IMHO their decision).
| So if if no one really cares I'm all for a consistent coding style (and
| -std=gnu89 or whatever).

perfect - my take is that good code not only works but is a fun and pleasure
to read.




More information about the Olsr-dev mailing list