Difference between revisions of "Cpp Coding Standards/FORMAT"
From Apache OpenOffice Wiki
m (Cpp Coding Standards/Code Format moved to Cpp Coding Standards/FORMAT: consistency) |
(formatting the topic sheets for better printing) |
||
Line 1: | Line 1: | ||
− | + | === Code Format (FORMAT) - Summary === | |
+ | ''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> ===== | |
+ | Always conclude your source file with a newline character. [[/Eof|-> Details]] | ||
− | + | ===== Source Code Character Set <span id="CharSet">(CharSet)</span> ===== | |
− | === | + | Don't use non-ASCII characters.<br> |
− | + | Exception: Use UTF8 encoding in resource files.<br> | |
− | + | [[/CharSet|-> Details]] | |
− | [[/ | + | ===== No Cpp Comments in C Code <span id="CppComm">(CppComm)</span> ===== |
+ | Don't use C++ comments in C code or C headers. [[/CppComm|-> Details]] | ||
− | ==== | + | ===== Indentation <span id="Indent">(Indent)</span> ===== |
− | + | Indentation is 4 spaces. [[/Indent|-> Details]] | |
− | + | ===== No Tabs <span id="NoTabs">(NoTabs)</span> ===== | |
− | + | Use spaces, not tabs. [[/NoTabs|-> Details]] | |
− | + | ||
− | + | ||
− | = | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ==== No Tabs <span id="NoTabs">(NoTabs)</span> ==== | + | |
− | Use spaces, not tabs. | + | |
− | + | ||
− | [[/NoTabs|Details]] | + | |
---- | ---- | ||
[[Category:Coding Standards]] | [[Category:Coding Standards]] |
Revision as of 14:17, 22 May 2007
Contents
Code Format (FORMAT) - Summary
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
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