On Mar 15, 2008, at 10:00 AM, SJS wrote:
Some rules are helpful; but more isn't always better. You can't force a programmer to generate good code by choosing the right coding standard.
Coding standards, however, help maintain consistency within a project (or organization).
My previous employer's developers had a style guide for all the code that was written at the company. I think it was, at most, two single- side sheets, printed, double-spaced, structured more as a list of guidelines and suggestions.
The counterpart to that was that all the developers were strongly urged to use VIm (or gVIm) for their editing, and the lead developer had provided an extensive set of enhancements to VIm that made it quite nearly painless to follow the style guide (in addition to tying in the build environment, debuggers, man pages and ctags.)
That type of environment would be impossible to enforce in an open- source project, I would think, simply because you have no idea who's contributing and what they prefer (or are willing) to work with. I don't think it's too crazy to at least offer some pointers as to what the project would consider acceptable style, such as:
* Please indent at increments of 4 spaces * Use of tabs in indents is acceptable * Try, where possible, to limit line length within 80 columns * Broken lines should continue at least one indent level deeper than the parent line * Use of a blank line (whitespace) to increase readability between blocks of code is recommendedProvide a couple example code snippets, and for me, that would likely be enough. Note, also, that I am not above changing my desired style given a compelling enough argument. :)
Gregory -- Gregory K. Ruiz-Ade <[EMAIL PROTECTED]> OpenPGP Key ID: EAF4844B keyserver: pgpkeys.mit.edu
PGP.sig
Description: This is a digitally signed message part
-- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
