In article <1992Nov20.213253.386@cs.mcgill.ca>, iceman@honey.cs.mcgill.ca writes:
|> Hello,
|>
|> What kind of convention is usually used for naming global variables?
|> I know Apple recommends adding a lower-case 'g' in front of the
|> variable name, e.g. gDeviceList. However, when using multi-file
|> projects, this doesn't differentiate between static globals (private
|> to the module) and extern globals (public globabls that can be
|> refered to from outside the module they're declared in).
|>
|> --
I would strongly recommend to avoid global variables at all !!!
Extern (non-static) globals give you lot's of problems when you organize your code (maybe later ?) in shareable images (I've ran into this under VMS and with Windows-DLL's).
Static (module-wide) globals must be handled VERY carefully to keep your code reentrant (sp?) and reusable.
Nearly any static I've used (expect from the typical "is_initialized") to store control-data did kick me in the ass in the worst moment it could ...
be aware, petzi
Petzi Schweda (sca@gese.ge14.mdadv.gv.at)
MD-ADV, Municipality of the City of Vienna, Austria