* HACKING: updated coding guidelines
This commit is contained in:
20
HACKING
20
HACKING
@ -1,6 +1,11 @@
|
||||
* HACKING
|
||||
|
||||
Here are some short guidelines for hacking on the 'mu' source code.
|
||||
Here are some short guidelines for hacking on the 'mu' source code. Note, this
|
||||
is fairly long list. This is not meant to discourage anyone from working on
|
||||
the mu source code; I think most of the rules are common sense anyway, and
|
||||
some of the more stylistic-aesthetic rules are clearly visible in current
|
||||
source code, so as long as any new code 'fits in', it should go a long way in
|
||||
satisfying these rules.
|
||||
|
||||
** Coding style
|
||||
|
||||
@ -13,7 +18,7 @@ Here are some short guidelines for hacking on the 'mu' source code.
|
||||
|
||||
2. lines must not exceed 80 characters
|
||||
|
||||
3. functions must not exceed 30 lines (there may be rare exceptions), and
|
||||
3. functions must not exceed 50 lines (there may be rare exceptions), and
|
||||
30 lines is already pretty long.
|
||||
|
||||
4. source files should not exceed 1000 lines
|
||||
@ -28,7 +33,7 @@ Here are some short guidelines for hacking on the 'mu' source code.
|
||||
declares a function of 'mu_foo_bar (int a);', mu-foo.c implements this.
|
||||
|
||||
8. non-global functions *don't* have the module prefix, and are declared
|
||||
static.
|
||||
static. Their names may start with '_'
|
||||
|
||||
9. functions have their return type on a separate line before the function
|
||||
name
|
||||
@ -41,14 +46,7 @@ Here are some short guidelines for hacking on the 'mu' source code.
|
||||
not to be freed, 'const char*' should be used instead
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#+ Local Variables: ***
|
||||
#+ mode:org ***
|
||||
#+ End: ***
|
||||
|
||||
|
||||
Reference in New Issue
Block a user