2001-10-03 10:51:43 +00:00
|
|
|
The following guidelines should be observed when coding cyphesis-C++.
|
2001-07-01 00:30:25 +00:00
|
|
|
|
|
|
|
|
REFERENCES
|
|
|
|
|
|
2001-10-03 10:51:43 +00:00
|
|
|
References should be used instead of pointers wherever it is possible.
|
2001-11-10 15:20:58 +00:00
|
|
|
If necessary the design of the code should reflect this preference. If a
|
|
|
|
|
pointer is to be used which will be initialised to a value, will never
|
|
|
|
|
change and can never be NULL, then that pointer should be a reference.
|
2001-07-01 00:30:25 +00:00
|
|
|
|
|
|
|
|
RETURN VALUES
|
|
|
|
|
|
2004-10-26 17:18:03 +00:00
|
|
|
Integer return values should be used when returning success or
|
|
|
|
|
failure. The C library convention of using 0 to indicate success, negative
|
|
|
|
|
numbers to indicate errors, and positive values to indicate other
|
|
|
|
|
statuses should be followed.
|
2004-06-28 15:50:43 +00:00
|
|
|
|
|
|
|
|
CODE FORMATTING
|
|
|
|
|
|
|
|
|
|
Hard tabs should not be used anywhere to format the code either in python
|
|
|
|
|
or C++. Normal white spaces should be used at all times.
|
|
|
|
|
|
|
|
|
|
In C++ 4 character indenting is used, with opening braces at the end
|
|
|
|
|
of lines, except at the beginning of methods and functions where they
|
|
|
|
|
should be at the beginning of a line containing no other characters.
|
2004-10-26 17:18:03 +00:00
|
|
|
|
|
|
|
|
With the exception of function definitions, { should always be at the end
|
|
|
|
|
of a line, and } should always be the first non-whitespace character on a
|
|
|
|
|
line. In the case of if or for statements, the clause should always be
|
|
|
|
|
enclosed by { } and the opening { should be on the same line as the if or for
|
|
|
|
|
statement.
|
2006-07-10 00:01:22 +00:00
|
|
|
|
2009-04-02 10:26:36 +01:00
|
|
|
DATA FORMATS
|
|
|
|
|
|
|
|
|
|
Data in the form of rules, and persistent stores conforms to the Atlas
|
|
|
|
|
protocol. Atlas uses strings in a variety of scenarios, the most common
|
|
|
|
|
being type names and property names. These names should be single English
|
|
|
|
|
words using British English spelling and should contain only lower case
|
|
|
|
|
alphabetic characters. Multiple words may be combined where they can
|
|
|
|
|
reasonably be considered as a single word together. A suitable example
|
|
|
|
|
would be "online" which has a distinct meaning alone, but is technically
|
2017-11-25 21:48:21 +01:00
|
|
|
correctly spelt as "on line".
|