Main Content

Sludge off the mountain, and Python and PHP

Archive - Originally posted on "The Horse's Mouth" - 2006-11-27 18:28:34 - Graham Ellis

Is Python 2.3 compatible with version 2.2? How about PHP 5.1 with PHP 4.4?

In an ideal world, the answer to every such compatibility question would be "yes, it is" but it's not always quite that simple. Python's upwards compatibility is excellent - as a language, it was designed for the purpose for which it's used to this day, and it's not overburdened with facilities, especially redundant ones, that make onward extension awkward. PHP, alas, started as "Personal Home Pages: and has grown to something much more powerful ... meaning that a few of the (then excellent) early decisions have had to be revisited and there have been a few compatibility issues - sometimes solved via the php.ini configuration file. (register_globals and magic_quotes come to mind ...).

However, there's always the exception to disprove the rule ... and I've been talking about Python compatibility today, and how the "yield" keyword was added for generators. "That would only be a problem if you happened to have a variable of that name" says I. "We do, quite often" says one of my trainees. "We're very often forecasting the yield of sludge running off a mountain in wet weather"