14. C++ Coding Conventions Coding convention is very essential for readability and maintenance of programs. And it also greatly improves the productivity of the programmer. Coding convention is required for good coding discipline. The following is suggested - inside class definition: * All public variables must begin with m like mFooVar. The m stands for member. * All protected variables must begin with mt, like mtFooVar and methods with t, like tFooNum(). The t stands for protected. * All private variables must begin with mv, like mvFooVar and methods with v, like vFooLone(). The v stands for private. * All public, protected and private variables must begin with uppercase after m like F in mFooVar. * All pointer variables must be prefixed with p, like o Public variables mpFooVar and methods like FooNum() o Protected variables mtpFooVar and methods with t like tFooNum() o Private variables mvpFooVar and methods with v like vFooNum() Uniform world-wide coding convention for C++ language will help better programming. In the sample code given below t stands for protected, v stands for private, m stands for member-variable and p stands for pointer. class SomeFunMuncho { public: int mTempZimboniMacho; // Only temporary variables should be public as per OOP float *mpTempArrayNumbers; int HandleError(); float getBonyBox(); // Public accessor as per OOP design float setBonyBox(); // Public accessor as per OOP design protected: float mtBonyBox; int *mtpBonyHands; char *tHandsFull(); int tGetNumbers(); private: float mvJustDoIt; char mvFirstName[30]; int *mvpTotalValue; char *vSubmitBars(); int vGetNumbers(); };