2001-12-11 20:47:02 +00:00
|
|
|
|
The coding style is almost the same as i blackbox.
|
|
|
|
|
Instead of 2 spaces there is tab.
|
2002-01-18 01:38:44 +00:00
|
|
|
|
Use a tab size of 2 or 4 and you will be fine.
|
2001-12-11 20:47:02 +00:00
|
|
|
|
|
2002-01-06 11:51:53 +00:00
|
|
|
|
if-statements:
|
2001-12-11 20:47:02 +00:00
|
|
|
|
|
|
|
|
|
if ( stuff )
|
|
|
|
|
function(stuff, more stuff,
|
|
|
|
|
more, even more);
|
|
|
|
|
else
|
|
|
|
|
morefunction( stuff, more stuff
|
|
|
|
|
stuff,
|
|
|
|
|
stuff,
|
|
|
|
|
stuff);
|
|
|
|
|
|
2002-01-06 11:51:53 +00:00
|
|
|
|
if the functionline needs to be split up, like above, right after an if-statement
|
2001-12-11 20:47:02 +00:00
|
|
|
|
use {<7B>and }, so its clear when the if-statement ends.
|
|
|
|
|
It should look like this
|
|
|
|
|
|
|
|
|
|
if ( stuff ) {
|
|
|
|
|
function(stuff, more stuff,
|
|
|
|
|
more, even more);
|
|
|
|
|
} else {
|
|
|
|
|
morefunction( stuff, more stuff
|
|
|
|
|
stuff,
|
|
|
|
|
stuff,
|
|
|
|
|
stuff);
|
|
|
|
|
}
|
|
|
|
|
|
2002-01-18 01:38:44 +00:00
|
|
|
|
If a line need to be splited in an if-statement then it should use two
|
|
|
|
|
tab for indent next row in if-statement like this:
|
|
|
|
|
|
|
|
|
|
if ( longline && longline && longling &&
|
|
|
|
|
longline && longline && longline)
|
|
|
|
|
funktion();
|
2002-01-06 11:51:53 +00:00
|
|
|
|
|
|
|
|
|
The include guards:
|
2001-12-11 20:47:02 +00:00
|
|
|
|
_FILENAME_HH_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Function comments:
|
|
|
|
|
//------------ function name --------
|
|
|
|
|
// This do that and that
|
|
|
|
|
// Returns this on success else
|
|
|
|
|
// this on failure.
|
|
|
|
|
// TODO: if there is something to do.
|
|
|
|
|
//-----------------------------------
|
|
|
|
|
type classname::function(...) {
|
|
|
|
|
|
|
|
|
|
}
|
2002-01-06 11:51:53 +00:00
|
|
|
|
|
|
|
|
|
|
2002-01-18 01:38:44 +00:00
|
|
|
|
enums must be in uppercase letters and not in file scope:
|
2002-01-06 11:51:53 +00:00
|
|
|
|
enum {WHITE, RED, BLUE};
|
|
|
|
|
|
2002-01-10 12:56:07 +00:00
|
|
|
|
Class data members are prefixed by m_
|
|
|
|
|
Class member function will be organized accordning to creator,
|
|
|
|
|
manipulator and accessor categories.
|