Difference between revisions of "Cpp Coding Standards/FORMAT"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Cpp Coding Standards/Topics/FORMAT moved to Cpp Coding Standards/Code Format: Improve Cpp_Coding_Standards structure.)
Line 1: Line 1:
== Code Format ==
+
Topic-Id: '''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.
 
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 ===
 
=== Summary ===
==== NewlineEof ====
+
==== Newline at End of File <span id="Eof">(Eof)</span> ====
 
Always conclude your source file with a newline character.
 
Always conclude your source file with a newline character.
  
==== SourceCharSet ====
+
[[/Eof|Details]]
 +
 
 +
==== Source Code Character Set  <span id="CharSet">(CharSet)</span> ====
 
Don't use non-ASCII characters.
 
Don't use non-ASCII characters.
  
 
Exception: Use UTF8 encoding in resource files.
 
Exception: Use UTF8 encoding in resource files.
  
==== NoCppComments ====
+
[[/CharSet|Details]]
 +
 
 +
==== No Cpp Comments in C Code  <span id="CppComm">(CppComm)</span> ====
 
Don't use C++ comments in C code or C headers.
 
Don't use C++ comments in C code or C headers.
  
==== Indent4 ====
+
[[/CppComm|Details]]
 +
 
 +
==== Indentation  <span id="Indent">(Indent)</span> ====
 
Indentation is 4 spaces.
 
Indentation is 4 spaces.
  
==== NoTabs ====
+
[[/Indent|Details]]
 +
 
 +
==== No Tabs  <span id="NoTabs">(NoTabs)</span> ====
 
Use spaces, not tabs.
 
Use spaces, not tabs.
----
+
 
=== Explanations ===
+
[[/NoTabs|Details]]
  
 
----
 
----
 
[[Category:Coding Standards]]
 
[[Category:Coding Standards]]

Revision as of 12:24, 29 November 2006

Topic-Id: 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

Newline at End of File (Eof)

Always conclude your source file with a newline character.

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