Re: uh oh, I defined a resoruce

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

 



Sancar Saran schreef:
On Sunday 13 January 2008 16:53:42 Jochem Maas wrote:
Sancar Saran schreef:
Well,

ADODB and TYPO3 are  successfull oss procjecs which uses PHP and they
utilizes globals at large.
windows is a successful OS but most people would agree it's built on a
foundation of cruft.

success != built with good code != globals are good practice.

Regards.

Sancar

Hello there,
After some research, I found source of the "Globals are evil".

This was coming from common c and c++ practice. In this enviroments using globals leding to race conditions which was very hard to resolve.

so? this has nothing to do with the reasoning about php globals being evil.


and uh oh, that php thing was using share nothing perspective. No race condtions.

no race conditions occur in code written in php? true that there is
no direct race conditions that can occur as a direct result of running code
but obviously you've never dealt with multi-user systems using a databse backend,
or file-writing based tools used in a web-environment (e.g. template output caching)
or anything that uses shared memory or trying to guanrantee that a command-line script
runs as a singleton. to name but a few examples that can most definitely be prone
to race-conditions.

oh and I believe you meant 'share nothing architecture'

except variable crashing.

I think you just made up 'variable crashing' - at any rate it not a concept
I understand to mean anything specific to the issue we are talking about.


From my point of view. After 8 years of php programming only one time face the variable crashing. And that was a local variable called $i.

well that seals it then - obviously globals are fantastic?!?

not to mention that this does not include any number of globals related
errors lurking in code[pathes] that is yet to be run or tested or errors that other
people have encountered in your code but that you know nothing about.


Of course your millage was vary...

it does, depending on how early or late I decide to change gear, the ammount of
traffic on the road, road-surface temperature, humidity, altitude, tyre-pressure,
octane number of the fuel I'm using and any number of other variables.

which is another way of saying - your mileage will vary.

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