

PHP vs Python (not a flame war, just a logical comparison of features) - Scott_MacGregor
http://wiki.python.org/moin/PythonVsPhp

======
deweller
I enjoy using PHP in spite of its quirks. But my main wish is that the PEAR
system was a bit easier to use. After seeing some Ruby Gems in action, it made
me wish that PEAR was a little slicker.

Does Python have a good and unified package installer like PEAR or Ruby Gems?

~~~
Derferman
Yes, Python has a robust package installer in pip[1]. Others use
easy_install[2], which works well but lacks key features such as uninstalling
packages. Both installers retrieve packages from PyPI[3].

[1]:<http://pip.openplans.org/>

[2]:<http://packages.python.org/distribute/easy_install.html>

[3]:<http://pypi.python.org/pypi>

------
pbiggar
You can't really compare languages based on feature lists like this. On top of
that, I glanced down the list, and noticed a couple of innacuracies, such as
the unset() thing. So I can't recommend someone to take anything from this
(and this from someone who hates PHP and likes Python).

------
alinajaf
Whenever I see comparisons like this they're usually written by someone who
prefers one over the other rather than 'a logical comparison of features'.
This is evident in language like 'schizophrenic tableau of function names'. I
prefer Ruby/Python over PHP, the syntax and language features are a lot more
predictable and sane in those languages than PHP. But I really think a drawn
out comparison like this is beating a dead horse.

------
kloncks
As much as I hate to admit it, the fact that this is on Python.org Wiki makes
it a biased source.

I gave it a chance and went ahead and read it. Sure enough, it sounded very
biased towards Python with many PHP inaccuracies.

I really would be interested in a true "logical comparison".

edit: this is coming from someone who primarily programs in php & python, but
with a lot more php experience.

------
all
I use Python a lot for back-end processing but seldom for anything upfront. I
tend to prefer PHP there. I was asked to write a book on Python last year and
actually included a section on how to use PHP together with Python when doing
web development. The two can live together quite nicely if you play their
strengths and weaknesses off each other.

~~~
lanstein
What is the book?

------
jayro
That's funny. It's actually more like a one-sided flame war. "PHP sucks and
Python is awesome!" ;)

~~~
vault_
I don't even think it was one-sided. Most of Python's strengths had a "retort"
afterwards explaining how that feature was in PHP 5. A good number of those
even had 'counter-retorts'!

------
scotty79
>> the ternary operator/statement (... ? ... : ...) > Retort: Python 2.5 has
conditional expressions

<http://www.python.org/dev/peps/pep-0308/> looks more like a hack than a
feature

~~~
koenigdavidmj
How's it a hack? They went through the entire standard library, saw that the
construct was generally used for the occasional exception to the common case,
and front-loaded the common case expression. The principle was that the
important thing should go up front.

~~~
scotty79
You are right. I misread this PEP. Sorry.

------
scotty79
> one array type that doubles as a list and a dictionary. Dictionary keys are
> iterated in their original order.

Retort: Python 2.7 and 3.1 finally has standard ordered dictionary type
(OrderedDict from collections) with basically same functionality.

------
st0p
Python might be the nicer language, php is still the language I encounter more
at my clients.

------
gaoshan
Based on that post they seem pretty equal. PHP comes out as slightly ahead on
web development with Python being more general purpose.

In a nutshell, not an especially useful post.

