Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HeLLsGamers SourceMod Formatting Standards
- (1) INDENTATION - Use 4 spaces for each indentation level. No TABs please.
- (2) BRACES - All braces should appear on their own line. Example - use "ANSI style" / a.k.a. "Allman style" rather than "K&R style".
- (3) SPACES:
- * No excess whitespace around parentheses. Example - use "while(x == y)" rather than "while (x == y)"
- * No excess whitespace inside parentheses. Example - use "while(x == y)" rather than "while( x == y )"
- * Use spaces around operators (except for i++ and i--) Example - use "a > 1" rather than "a>1".
- * Use spaces after inline punctuation. Example 1 - use "a, b, c, d, e" rather than "a,b,c,d,e". Example 2 - use "for(i = 0; i < x; i++)"
- instead of "for(i = 0;i < x;i++)"
- (4) LINE BREAKS:
- * Please break lines (both comments and code) exceeding column 150 to the next line.
- * The next line(s) should be indented 1 level (4 spaces) in relation to the first line.
- * If you want to break lines before column 150, that's up to you.
- (5) COMMENTS:
- * Aside from temporary debugging comments, please do not put trailing comments after a line of code. All comments should be immediatly
- above the line(s) of code they describe.
- * To delimit main sections, use a line like this: // ###################### SECTION TITLE HERE ######################
- * Code comments should be in proper english with proper capitalization and punctuation.
- * Single-line comments should have a space after the double slash. Example - "// Description here."
- (6) VARIABLE NAME CONVENTIONS:
- * Global variables should be prefixed with "g_" and then a letter indicating what datatype it is:
- - "h" for Handle
- - "b" for Bool
- - "i" for Int
- - "f" for Float
- - "s" for String
- - (etc)
- * On global variables, the next letter, immediatly following the indicator, should be capitalized. Example - g_bMyBool or g_hMyHandle.
- * Local variables (including parameters in function definitions) do not have to be prefixed with anything, and can use any convention.
- However, please use a consistent convention for all local variables within the same function.
- (7) FUNCTION NAME CONVENTION - Function names should have EachWordCapitalized().
- (8) PREPROCESSOR MACRO NAME CONVENTION - Defines should be in ALL_CAPS with underscores delimiting each word.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement