[Olsr-dev] questions regarding v2 coding style / lang
Harald Geyer
(spam-protected)
Mon Sep 8 14:24:14 CEST 2008
Bernd Petrovitsch <(spam-protected)> wrote:
> Define variables in the most inner block.
> Rationale: No one wants to scroll up and look for the definition.
Has this already made it into some widely supported standard? Not
everything is gnu, last time I checked I think (well it's quite some
time ago) AIX cc didn't like that and why would anybody want to write
unportable code?
OTOH I'm not sure if block local definitions are that much of a nice
idea at all: Having the same variable with different definitions in
different blocks of the same function is quite confusing while the
scroll up problem can be avoided with writing short functions - not
because they fit on one 80x24 screen, but because it's easier to
remember.
> ad formatting: Use Linux kernel coding style[3] except
I think that's not only for formatting but also for other things
like length of functions (see above) a good guide.
> - the above "use { ... } everywhere"
> - indent 4 (and not 8) positions.
What's the rationale behind that?
Harald
More information about the Olsr-dev
mailing list