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

Maciej Stachowiak mjs at apple.com
Sat Jun 12 16:46:28 PDT 2010

On Jun 4, 2010, at 3:54 PM, Joe Mason wrote:

> 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.

I think file-scope static globals don't need a prefix. In the few cases of globals with extern linkage, I think a prefix would make them needlessly unpleasant to use. HTMLNames.h is one of the most prominent examples. I don't think we'd want to write g_divTag and g_widthAttr instead of divTag and widthAttr.


More information about the webkit-dev mailing list