6 ms·
PHP vs Python (not a flame war, just a logical comparison of features)
- deweller 16y agoI 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?
- Scott_MacGregor 16y agoI agree, PEAR does need to be easier. Maybe somebody in here can make some decent quick money making PEAR better to use.
- Derferman 16y agoYes, 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/ http://pip.openplans.org/ [2]:http://packages.python.org/distribute/easy_install.html http://packages.python.org/distribute/easy_install.html [3]:http://pypi.python.org/pypi http://pypi.python.org/pypi
- st0p 16y agoPython might be the nicer language, php is still the language I encounter more at my clients.
- jayro 16y agoThat's funny. It's actually more like a one-sided flame war. "PHP sucks and Python is awesome!" ;)
- vault_ 16y agoI 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'!
- all 16y agoI 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 16y agoWhat is the book?
- alinajaf 16y agoWhenever 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.
- pbiggar 16y agoYou 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).
- kloncks 16y agoAs 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.
- scotty79 16y ago> 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.
- scotty79 16y ago>> the ternary operator/statement (... ? ... : ...) > Retort: Python 2.5 has conditional expressions http://www.python.org/dev/peps/pep-0308/ http://www.python.org/dev/peps/pep-0308/ looks more like a hack than a feature
- koenigdavidmj 16y agoHow'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 16y agoYou are right. I misread this PEP. Sorry.
- gaoshan 16y agoBased 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.