On Thu, 2003-07-17 at 18:35, Ow Mun Heng wrote:
> Hi All,
> 
>       Just a quick question on this. In my scripts, I'm using A LOT Of
> $GLOBALS['my_parameter'] to get the declared values/string. 1 example  below
> :

The only real problem is if you ever want to use that code in anything
else. Using lots of globals will make that harder, since it will mean
that you cannot simply lift that function out and drop it into some
other chunk of code without making sure that the new global space
contains all those globals, and that they contain what you expect.

This is called 'tightly-coupled' code. It's just harder to reuse.

'Loosely-coupled' code relied much less on the environment around it.
It would typically receive its values through an argument list, array
of values it needs, or perhaps by being a method in a class which has
attribute values for all of the necessary stuff.

Other than that, it's not a huge issue.


-- 
 Torben Wilson <[EMAIL PROTECTED]>                        +1.604.709.0506
 http://www.thebuttlesschaps.com          http://www.inflatableeye.com
 http://www.hybrid17.com                  http://www.themainonmain.com
 -----==== Boycott Starbucks!  http://www.haidabuckscafe.com ====-----




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to