| Forbidden: | Read_Master_Data() |
| Allowed: |
ReadMasterData(); Accnt_ReadMasterData(); |
Multi-lingual names (GetStapelEintrag) are strictly forbidden.
Names or parts of names that have the significance of key words are chosen in english. These exceptions are explicitly pointed out. There are no other exceptions.
typedef int ALERT_PRIORITY;
typedef enum { F_RED, F_GREEN, F_BLUE } COLOR;
typedef enum { AC_READONLY, AC_WRITEONLY, AC_RANDOM } MEM_ACCESS;
typdef struct CComplex // though typedef, mixed case for structs!
{
float m_fReal;
float m_fImag;
} CComplex;
class CDatabase;
class CFastMemory;
typedef CComplex* PComplex;
typedef CFastMemory* PFastMemory;
int nUpperLimit;
CDocument theDocument;
void* pDataBuffer;
int _nTotalNumerOfErrors = 0;
int* Mmgr_pTheOnlyMemoryPool;
#define UPPER_LIMIT 1234
const int UPPER_LIMIT = 1234;
const int nUpperLimit = 1234;
const int Stack_nUpperLimit = 1234;
int nFehler;
int nGesuchterWert;
LPCSTR lpszBenutzerName;
class CErrorState
{
int m_nStateCode;
LPCSTR m_lpszErrorMessage
};
#define ABS(x) (0 > (x) ? -(x) : (x))
(C++) Using macroes is inadmissable. Use inline- or template functions instead.
void SearchTree(const PNode pExpressionTree);
BOOL Msg_MessageIsPresent(void);
| not | TagesdatumSetzen(const PGmsDatum pDatum), |
| but | SetzeTagesdatum(const PGmsDatum pDatum); void SendePaket(const PGmsPaket pPaket); ERRORTYPE PruefeName(LPCSTR pName); |
ALERT NextAlert(const PTIME pStartingTime);
LPCSTR UserName(const int nUserId);
and not:
LPCSTR ReadUserName(int nUserId)!
bool IsValidName(LPCSTR pName);
bool HasChildren(void);
int HexToBinary(LPCSTR lpszHexNumber);
void BuildTime /* (C) */
(
PTime this,
const int nHours,
const int nMinutes,
const int nSeconds
);
PTime NewTime
(
const int nHours,
const int nMinutes,
const int nSeconds
);
void DeleteTime(PTime pTime);
(C++, Delphi) Initialization functions are inadmissable. Use constructors, cast operators and destructors instead (C++: in context with new and delete operators). Namen of functions that allocate heap memory for the returned object, which must be deallocated by the caller, start with New.
Essential parts of the succeeding tables have been suggested by Microsoft for Windows applications [Petz90].
|
prefix |
type |
description |
example |
| c | char | 8-bit character | cRank |
| b | bool | boolean | bActivated |
| q | bit | bit (C51) | qActivated |
| n | int | integer (size depends on operating system) | nLength |
| l | long | 32-bit integer signed | lOffset |
| u | UINT | unsigned value (size depends on operating system) | uCount |
| ul | unsigned long | long unsigned value (depends on operating system) | ulRange |
| f | float | 32-bit IEEE floating point | fSine |
| df | double | double precision IEEE floating point | dfDistance |
| p | * | generic pointer (MS-DOS or Windows up to V3.11: according to memory model) | pDoc |
| r | & | references (except const &) | rDoc |
| sz | char[] | '\0'-terminated string | szName |
| psz | char* | pointer to '\0'-terminated string | pszName |
| s | string | Pascal string | sName |
struct CConfigurationData;
CConfigurationData cnfDevice1;
The sample prefix Mod replaces a useful abbreviation of the module name (preferribly 3-5 characters).
|
prefix |
type |
example |
| C | class or Struct | CDocumentHandler |
| P | pointer type for a pointer to class or struct | PDocumentHandler |
| R | reference type for references to a class or struct | RDocumentHandler |
| m_ | data element | m_pDocHandler |
| a | vector (array) | caName[] |
| Mod_ | public funktion or data type (C++, Delphi: except class members) | Math_ReadData() Math_nErrorCount |
| _ | private funktion or variable | _DateToInteger() _lpszProtocol |
|
prefix |
type of symbol |
example |
range |
| IDR_ | identifier to miscallenous resources of different types | IDR_MAINFRAME | 1…0x6FFF |
| IDD_ | dialogue resource | IDD_SPELLINGCHECKER | 1…0x6FFF |
| HIDD_ | help context of a dialogue resource | HIDD_SPELLINGCHECKER | 0x20001…0x26FFF |
| IDB_ | bitmap resource | IDB_LOGO | 1…0x6FFF |
| IDC_ | cursor resource | IDC_PEN | 1…0x6FFF |
| IDI_ | icon resource | IDI_NOTEPAD | 1…0x6FFF |
| ID_ | menu or toolbar command | ID_CMD_SPELLINGCHECKER | 0x8000…0xDFFF |
| HID_ | help context of a command | HID_CMD_SPELLINGCHECKER | 0x18000…0x1DFFF |
| IDP_ | message box prompt | IDP_INVALID_PARTNO | 8…0xDFFF |
| HIDP_ | help context of a message box | HIDP_INVALID_PARTNO | 0x30008…0x3DFFF |
| IDS_ | string resource | IDS_COPYRIGHT | 1…0x7FFF |
| IDC_ | control of a dialogue box | IDC_RECALC | 8…0xDFFF |
[continue with "Programming Style Guide"] | [TOC] | [Introduction] | [Layout] | [Programming Style Guide] | [Annexes]
Copyright © 1997-98 by Uwe Sauerland