...
- (status of this guideline: proposed by DanielQuinlan. everyone happy with it?)
- (+1 – JustinMason)
- (+1 – DuncanFindlay who has finally weened himself off cuddled elses)
One liners
";" should always be at the end of a line unless its a "for", no points for squeezing more code on the same line.
...
- (status of this guideline: proposed by DanielQuinlan. everyone happy with it?)
- (+1 – JustinMason)
- (+1 – DuncanFindlay - shift should be fine for one argument subroutines, IMO)
Accessors
We don't use perl-style accessors very frequently (ie.
...
- (status of this guideline: proposed by JustinMason. everyone happy with it?)
- (+1 – Daniel Quinlan except where we already do this)
Return Values From Functions
...
- (status of this guideline: proposed by JustinMason. everyone happy with it?)
- (+1 – Daniel Quinlan)
- (+1 – DuncanFindlay)
C CodingStyle
In our C code we took the easiest way and adopted the Apache Developers' C Language Style Guide.
One addition, arising from bug 4593: if there are warnings about variables being signed/unsigned, caused by use of "int" types in system calls that accept "size_t" (or similar), it is better to *carefully* perform a cast in the call(s) to the specific system calls being warned about, instead of changing the type of variables on a global scale to be a "size_t". Bug 4593 is a good example of how this can cause bugs as a side-effect due to -1 being used as an error indicator.