> '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.

The $GLOBALS['parameter'] is actually defined in ONE(a config file that
houses all the parameters and another a language file) place where it can be
changed. So, i would say that's an argument list, is it not?

The other way would be to write a function that obtains that from the
argument list. But as I see it, it's basically the same thing? NO?

Class.. That's not somewhere I would want to venture, not right now anyway.
Just starting out.

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-----Original Message-----
From: Lars Torben Wilson [mailto:[EMAIL PROTECTED]
Sent: Friday, July 18, 2003 12:05 PM
To: Ow Mun Heng
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Too much of $GLOBALS[] a problem??


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.

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