Hi,
Here
is the first version of the 'Programming standards'.
Part
of the standards are already implemented by people. We
think
it is very important to keep the programming standards
equal
for all teams, and it's better to start late than never.
Please,
read it and keep doing your work in accordance with the
following:
Headers
for files
=================
static
char rcsId[]="$Header: $";
/*****************************************************************
**
$Header: $
**
Project: <project name
or common>
**
File Name: <file name>
**
System: <MD, OS, common ...>
**
Process: <process name or NA if its a library>
**
Library: <library name or NA if its a process>
**
Created: DD.MM.YY
**
Author: John Doe
**
description:
**
Dependencies:<option
but recommended>
**
**
Change Log:
**
1) 13.1.98 - David Morgan
**
Added parameters for the tcpProc
**
EIU_ClntLOG_TheProcessParamsPath
**
EIU_ClntOM_TheProcessParamsPath
**
EIU_ClntCONF_TheProcessParamsPath
**
EIU_ClntALARM_TheProcessParamsPath
**
2) 14.1.98 - Dan Taylor
**
Uncommented the parms CCS_PerfItem3 and
**
PM_PerfItem4 - for the menu in Exchange
**
window in Atlas Gui.
**
3) 4.3.98 - David Morgan:
**
...
Headers
for functions
=====================
/*******************************************************************
**
Function name: <function name>
**
Input parameters:
**
parameter 1 - description
**
parameter 2 - description
**
parameter 3 - description ...
**
Output parameters:
**
parameter 1 - description
**
parameter 2 - description ...
**
Return value: type and description
**
Restriction: optional
*******************************************************************/
Headers
for Classes
===================
/*******************************************************************
**
Class name: <function name>
**
description: The 'RouterPort' use to test the physical
**
connection between the MD and a serial
**
interface of an MD local Router.
*******************************************************************/
C
/ C++ naming conventions
==========================
Rule
1:
macros
WHICH ARE NOT RECOMMENDED should be all in uppercase
#define
MACRONAME (A,B)
===============================================================
Rule
2: For the private and protected member data use the:
<name>_
notation
int
myIntData_;
===============================================================
Rule
3: For the static member data use the:
<name>_s
notation ("s" in lower case)
static
int myStaticInt_s
===============================================================
Rule
4: For the static member function use the:
<name>_S
(i.e. handlePingTimesOut_S - "s" in upper case)
===============================================================
Rule
5:
Names of functions should describe an action
get..,
check.. and not nouns like UserState
(i.e.
getUserState)
Names
of variables should be noun.
(i.e
intCounter)
================================================================
Rule
6: global variables:
g_<name>
=================================================================
Rule
7: pointers should be of form
p<name>
pp<name>
(for pointer to pointer)
char*
pMyChar;
===================================================================
Rule
8: For function
parameters use:
<name>_i
- for input parameters
<name>_o
- for output parameters
<name>_io
- for input/output parameters
static bool
asciiToEbcdic(string
str_i,string & str_o)
=====================================================================
Rule
9: Function names start with lowercase
(i.e. addPrefix() )
Class
names start with uppercase (i.e. Trkgrp )
variable
names start with lowercase (i.e. switchName )
each
word that follows begins with an uppercase.
================================================================