TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
C++ Coding Standard

Rule:  NAM#007

This rule is Obsolete
Synopsis:Accessor method names should correspond with the attribute being accessed
Severity Level:10


When a class needs to declare accessors the name of these accessors needs to correspond with the attribute being accessed, combined with Set or Get based on the type of operation being performed by the accessor. As an example: when a class holds attribute name, the internal representation of this name might be:

CString m_sName;

The accessors belonging to this attribute would be declared as follows:

const CString& GetName() const;
void SetName(const CString& rsName);

The use of get and set methods is not encouraged.