BARR C CODING STANDARD

These are the key ideas of the coding standard

  1. Indent code only with spaces

  2. No multiple variable declarations on a single line

  3. No line of code shall contain more than one statement

  4. Limit source code lines to 80 characters or less

  5. Braces must always surround code blocks even if that block is a single line of code. The opening and closing brace must be at the same indentation level

  6. Blank lines must surround natural code blocks

  7. Each file shall end with a comment signifying the end of the file followed by a blank line:

1 ...
2
3 // End of file main.c

Last updated