Content deleted Content added
No edit summary |
|||
Line 32:
is not permitted under the guidlines.
For a function, the curly brackets should be on the first line, on seperate lines. The body of the function should be indented two spaces in.
Statements such as the '''if''' statement should be styled like this:
foo()
{
if (foo == bar)
{
puts(bar);
}
}
Each statement (in this case, '''if''') should be indented from the starting curly bracket. If the statement is a compound statement the curly brackets of its own should be indented two more spaces judging by the statement's position.
'''do-while''' statements should be written like this:
do
{
foo(bar);
}
while (foo == bar)
= Comments ==
Based on the standard, all comments should be in [[English_language]]. Each comment should have basic punctuation, but if a lower case identifier comes in the start of a sentence , you are not meant to capatilise it.
According to the standard, a brief comment at the top should explain the program use. This comment should be at the top of the source file containing the main() function.
Comments should also be at the top of functions, explaining what they do and what arguments they recieve. To the standard, it is not neccasary to dupicate the meaning of the functions arguments, if they are being used in a customary fashion.
The standard determines that there is no need to re-state the name of the function, the reader can see it for his or her self.
Every '''#endif''' should have a comment, explaining the condition that is being ended and its sense. Also, every '''#else''' statement should have the same sort of comment after it.
The standard asks that when a programmer enters a comment, the standard asks that two spaces are put on the end of the sentence so that the Emacs sentence commands work.
== Files (Temporary, Configuration and/or Backups) ==
|