Re: Opinion about the using $GLOBALS directly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Richard Lynch wrote:
On Wed, December 19, 2007 11:22 am, Stut wrote:
well, if you have a long and complex function declaration which
begins
with global $whatever, and then all over the function $whatever is
used,
some dozens of lines later when looking for something in the code
you
might not have any idea that $whatever is global... however if you
used
$GLOBALS['whatever'] everywhere it would be trivial.
Indeed.

I don't really care how long the function is.

$connection is a global in the scripts.

It's the only global there is.

It's a global in any function that needs it.

If I can't remember that from day to day, then I need to find a nurse
to take care of me...

[shrug]

I feel sorry for anyone that ever inherits your code. You're making their life needlessly more difficult. I've inherited enough code in my time to appreciate the extra effort to create readable and maintainable code.

-Stut

--
http://stut.net/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux