Difference between revisions of "Kernel Normal Form"
Jump to navigation
Jump to search
(Added comments style) |
|||
Line 20: | Line 20: | ||
== Comments == | == Comments == | ||
+ | * The top of any file should contain a comment with the file name and major public functions (as well as the copyright once it is determined) | ||
+ | * Functions should follow normal javadoc (doxygen in our case) style | ||
+ | * Comments should be follow /* ... */ style and vary depending on line size | ||
+ | |||
+ | == Example == |
Revision as of 21:48, 26 June 2007
Tabs
- Use tabs to indent code.
- Use spaces to position comments that appear to the right of code.
Braces
- For functions and control blocks, the brace goes on its own line.
- Control blocks can be compressed to
Spaces
- Spaces around operators are recommended, around
=
are required. - The parenthesis following a keyword is always prefixed by a space.
- Following a function call or declaration, there is no space between the name and the opening parenthesis.
Function Naming
- Function names use Java style lowerCamelCase, following Java conventions on capitalization edge cases.
- Avoid unnecessary abbreviation in function names as reasonable.
Global Variables
- Global tables are named after the related structure with the suffix "tab", such as
devicetab
,processtab
, etc.
Comments
- The top of any file should contain a comment with the file name and major public functions (as well as the copyright once it is determined)
- Functions should follow normal javadoc (doxygen in our case) style
- Comments should be follow /* ... */ style and vary depending on line size