Ken Ismert
KIsmert at TexasSystems.com
Mon May 16 17:46:12 CDT 2005
John, >I would argue with that ... >Making this a global allows functions that have no >business setting these variables to change them. By >having a private variable returned by a public function, >any function that needs the information can get it but >cannot modify it. I agree: this is the most 'air tight' approach. However, I tend to relax my standards if I have favorable ground rules. For instance, if it is all my code, I trust myself (mostly), and will probably be less strict about globals. But, if I am working with others, or am using code libraries from other sources, I would likely package the globals as you suggested. I would far rather have a colleage complain about "not being able to change the %&*#@ parameter X", than have the app fail in production later. -Ken