JavaScript:SpiderMonkey:Coding Style: Difference between revisions

Jump to navigation Jump to search
Line 272: Line 272:
       ...
       ...
  }
  }
* Member variable names, private or public, are '''not''' decorated. Examples of improper decoration include:
* Member variable names, private or public, are sometimes decorated with a trailing '_'.
  class Fail
  class Fail
  {
  {
     size_t capacity_;  // unsightly
     size_t capacity;  // common
     T *mBegin;         // makes babies cry
     T *begin_;       // also common, being used more as time goes on
    T *m_end;          // much typing
  }
  }
Sometimes a canonical argument name may conflict with a member name.  In this case, one can disambiguate with "this->", although such explicit qualification should only be added when necessary:
Sometimes a canonical argument name may conflict with a member name.  In this case, one can disambiguate with "this->", although such explicit qualification should only be added when necessary:
Confirmed users
1,345

edits

Navigation menu