On Sep 2, 2009, at 9:59 AM, Yong Li wrote:
I think global variables should start with "g_".
-Yong
I actually agree fairly strongly that constants and global/static
variables should have consistent, identifiable prefixes.
For globals, having a prefix code easier to understand with a quick
scan. If the global has no prefix, you have to search for it and
discover that it's not a local variable, member variable or parameter
before understanding where it comes from. This is a particular problem
in Xcode, which does not use a different syntax highlight color for
globals (unlike the venerable CodeWarrior). I also think that globals
are a particular concern because they impact thread safety, and
misunderstanding their scope of influence can have bad ramifications.
Using a prefix for constants also reduces brainprint when scanning
code; you know that its value is never going to change.
Simon
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev