Drew Wutka
DWUTKA at Marlow.com
Sat Sep 24 11:14:05 CDT 2011
So what about a string of functions that you feed a variable, which are byref for their arguments? You would still be 'tracking down' the culprit. I really don't see how a global is that much different in trouble shooting. I completely agree that a global class makes things much easier, it is also cleaner. You can group the values you want into a class, which simply makes more sense too. If you have a dozen global variables, used to hold system settings, why not make a SystemSettings class, easier and more logically combined. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kenneth Ismert Sent: Friday, September 23, 2011 3:41 PM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Global Vars (was Ambiguous Name) > Drew Wutka: > A global variable will ONLY fail in the SAME way that a modular or > procedural variable will. > ... > #1. 'A global variable can be changed from anywhere.... so it could > get a bad value'. Really? So let's look at a procedural variable: > ... > Holy Division by Zero Batman. We just 'broke' a procedural variable! ... > You're right, but for one TINY difference ... in your procedural example, you can raise an error up the call chain, and immediately finger the bad actor. In all of the global parameter schemes put forth so far, you don't get that. The failure chain is: 1. Good actor sets global. Time goes past... 2. Bad actor changes global to a 'bad' value, which is accepted without error... 3. Other actor uses global -- BAM! BIF! POW! error. But who did the dirty deed? You can't easily tell. This is the crux of the 'globals are bad' arguement. Without knowing WHO made each change, you're stuck with a tedious debugging mess. But again, talking to the 'globals are bad' camp, I say your solutions so far don't solve the problem. How do you propose fixing the problem? -Ken -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.