-
Notifications
You must be signed in to change notification settings - Fork 16
Programming Style
adlan edited this page Feb 16, 2011
·
2 revisions
- Length of line must not exceed 80 characters
- Use K&R style (1TBS variant)
- 2 spaces for indentation. Use whitespace instead of tab
- Put function name after closing brace
void doSomething()
{
} // doSomething()
- When function have more than one arguments, if there are any argument of type
bool
, useenum
instead. Define the option inBOption
enum.
// so when calling a function,
configureRxDescriptor(index, kBDOptionReuse);
// is more descriptive than
configureRxDescriptor(index, true);