Summary: | Update the style guide re: static member variables and structs | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jeremy Orlow <jorlow> | ||||||||
Component: | New Bugs | Assignee: | Jeremy Orlow <jorlow> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | darin, tkent | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Other | ||||||||||
OS: | OS X 10.5 | ||||||||||
Attachments: |
|
Description
Jeremy Orlow
2010-05-25 02:07:19 PDT
Created attachment 56995 [details]
Patch
Comment on attachment 56995 [details] Patch > -<li>Prefix C++ data members with "m_". > +<li>Prefix C++ class member variables with "m_" and do not make them public. The term "data members" is correct C++ terminology. The term "member variables" is not correct C++ terminology. I would write: Prefix C++ data members with "m_" and static data members with "s_" and do not make them public > +<li>Static member variables should be prefixed with "s_".</li> The correct term is "static data members". (In reply to comment #2) > (From update of attachment 56995 [details]) > > -<li>Prefix C++ data members with "m_". > > +<li>Prefix C++ class member variables with "m_" and do not make them public. > > The term "data members" is correct C++ terminology. The term "member variables" is not correct C++ terminology. I would write: > > Prefix C++ data members with "m_" and static data members with "s_" and do not make them public Does "C++ data member" imply class (vs. structs)? Even if so, I think we should explicitly explain that public data members are OK with structs but not classes. > > +<li>Static member variables should be prefixed with "s_".</li> > > The correct term is "static data members". I will delete this and mention it above instead. (In reply to comment #3) > Does "C++ data member" imply class (vs. structs)? Even if so, I think we should explicitly explain that public data members are OK with structs but not classes. "data member" is used for structs too in the standard. Created attachment 57088 [details]
Patch
Comment on attachment 57088 [details] Patch > -<li>Prefix C++ data members with "m_". > +<li>All data members in C++ classes must be private. Static data members should be prefixed by "s_". All other data members should be prefixed by "m_". Why the "must" vs. "should" here? I don’t think we need the word “All”. Created attachment 57233 [details]
Patch
Committed r60346: <http://trac.webkit.org/changeset/60346> |