Difference between revisions of "Cpp Coding Standards/FORMAT"

From Apache OpenOffice Wiki
Jump to: navigation, search
m
(Code Format (FORMAT) , added newlines)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
== Code Format (FORMAT) - Summary ==
+
== Code Format (FORMAT)==
 
''Generally, how to format the code does not need to be be governed by rules. Here are only a few things necessary for correct compiler behaviour or to increase code readability significantly.''
 
''Generally, how to format the code does not need to be be governed by rules. Here are only a few things necessary for correct compiler behaviour or to increase code readability significantly.''
  
 
===== Newline at End of File <span id="Eof">(Eof)</span> =====
 
===== Newline at End of File <span id="Eof">(Eof)</span> =====
 
Always conclude your source file with a newline character. [[/Eof|-> Details]]
 
Always conclude your source file with a newline character. [[/Eof|-> Details]]
 +
 +
===== Unix-style Newlines <span id="Newlines">(Newlines)</span> =====
 +
Always use unix-style (NL, not CR NL) newlines. [[/Newlines|-> Details]]
  
 
===== Source Code Character Set  <span id="CharSet">(CharSet)</span> =====
 
===== Source Code Character Set  <span id="CharSet">(CharSet)</span> =====

Latest revision as of 15:26, 10 December 2008

Code Format (FORMAT)

Generally, how to format the code does not need to be be governed by rules. Here are only a few things necessary for correct compiler behaviour or to increase code readability significantly.

Newline at End of File (Eof)

Always conclude your source file with a newline character. -> Details

Unix-style Newlines (Newlines)

Always use unix-style (NL, not CR NL) newlines. -> Details

Source Code Character Set (CharSet)

Don't use non-ASCII characters.
Exception: Use UTF8 encoding in resource files.
-> Details

No Cpp Comments in C Code (CppComm)

Don't use C++ comments in C code or C headers. -> Details

Indentation (Indent)

Indentation is 4 spaces. -> Details

No Tabs (NoTabs)

Use spaces, not tabs. -> Details


Personal tools