[webkit-dev] Style question: static, protected, or public members

Joe Mason jmason at rim.com
Fri Jun 4 15:54:58 PDT 2010


I'm strongly in favour of g_.  It seems weird and ugly to me to have
prefixes for some non-local scopes but not all.  And it's very helpful
to be able to look at a variable reference and immediately know that
it's a global, and not a local whose definition you skimmed over.

Joe

-----Original Message-----
From: webkit-dev-bounces at lists.webkit.org
[mailto:webkit-dev-bounces at lists.webkit.org] On Behalf Of Darin Adler
Sent: Wednesday, June 02, 2010 1:03 PM
To: Eric Seidel
Cc: WebKit Development
Subject: Re: [webkit-dev] Style question: static, protected,or public
members

On Jun 1, 2010, at 10:09 PM, Eric Seidel wrote:

> Let me summarize to see if I understand what should be updated in the
style guide/check-webkit-style:
> 
> Class static member variables should have an s_ prefix.
> Protected and public member variables should be disallowed.
> Private member variables should have an m_ prefix.
> Struct member variables should have no prefix.

Yes, I think that's what we discussed. While I don't love the "s_"
prefix, I didn't love the "m_" one either, and I got used to it.

> What about global statics?  Currently I believe most have no prefix.
Some have "k" or "g".

We didn't discuss global variables outside of a class. If we decided to
start using a prefix, I'd suggest "g_" but I don't think we need one.
What do other people think?

    -- Darin

_______________________________________________
webkit-dev mailing list
webkit-dev at lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.


More information about the webkit-dev mailing list