08-27-2009, 01:18 PM
My personal preference is closest to the K&R style nowadays, with spacing like in [Griffin]'s example:
I'm fine with pretty much anything though, as long as everybody follows the same conventions.
Code:
public SomeCallback ()
{ // Opening function brace on a new line
for (new i = 0; i < SLOTS; i++) { // Opening brace on the same line in control structures
if (!IsPlayerConnected (i)) continue; // No braces around single statements such as these
SendClientMessage (i, COLOR_WHITE, "Hello there!");
DoSomeMoreStuff ();
}
// Note the use of empty lines for clarity
return 1;
}
I'm fine with pretty much anything though, as long as everybody follows the same conventions.