Contents Index Previous Chapter Next Chapter


Code Standards

To Top Code Standards

None are really being inforced due to the large number of developers
each with their own styles but broadly below is an example

#ifndef MYCLASS_H_
#define MYCLASS_H_

class CMyClass
{
int m_iInteger ;
CString m_sString;
void private_member_function();
public:
CMyClass();
~CMyClass();
protected:
void ProtectedMemberFunction() ;
public:
void Public_Member_Function() ;
};

#endif
Member variables are m_<type>Name;
Private member function s are lower case, maybe with an underscore between token names
Protected Members have capitals but no underscores
Public members have both capitals and underscores

Note these are not hard rules as what would you make of Fetch() ?
Is it protected or public

if ( !apple() && banana() || cherry() )
Is Not The Same As:
if ( (!apple()) && (banana() || cherry()) )
Take Care As Visual C++ Does Not Always Give ! highest precidence in debug mode.

Contents Index Previous Chapter Next Chapter To Top


© 2001 by Montego Data Limited® All rights reserved.