Difference between revisions of "Cpp Coding Standards/FORMAT"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
m
Line 2: Line 2:
 
How to format the code generally should not be governed by rules. Here are only a few things that are necessary for correct compiler behaviour or increase code readability significantly.
 
How to format the code generally should not be governed by rules. Here are only a few things that are necessary for correct compiler behaviour or increase code readability significantly.
 
----
 
----
=== Rules ===
+
=== Summary ===
 
+
 
==== NewlineEof ====
 
==== NewlineEof ====
 
Always conclude your source file with a newline character.
 
Always conclude your source file with a newline character.
Line 20: Line 19:
 
==== NoTabs ====
 
==== NoTabs ====
 
Use spaces, not tabs.
 
Use spaces, not tabs.
 +
----
 +
=== Explanations ===
 +
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 18:12, 27 November 2006

Code Format

How to format the code generally should not be governed by rules. Here are only a few things that are necessary for correct compiler behaviour or increase code readability significantly.


Summary

NewlineEof

Always conclude your source file with a newline character.

SourceCharSet

Don't use non-ASCII characters.

Exception: Use UTF8 encoding in resource files.

NoCppComments

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

Indent4

Indentation is 4 spaces.

NoTabs

Use spaces, not tabs.


Explanations


Personal tools