PHP vs. Python: 语言流行程度
毋庸置疑PHP非常的流行；实际上，它现在是最流行的开源编程语言。PHP开发者和PHP工作都是一抓一大把。现在，在Seek.com.au上，澳大利亚就有大概3790个PHP职位。并且这种需求通常转化为一个巨大的开发者资源池，在需要扩展你的团队时，随时可以从中选出可用的开发者。（And this demand generally translates into a large pool of developers that can be tapped into when you want to expand your team.）
PHP vs. Python: 语言语法
PHP vs. Python: 做事情的方法不止一种
PHP经常让人觉得它纯粹是为了创建Web页面而设计的，即使一些人用它完成一些别的任务。默认情况下它的确是嵌套了代码的HTML模板。与之相对，Python是一种独立的（stand on one's own two feet）通用型语言。使用Python进行Web开发涉及选择一种能为你提供所需功能的Web框架。然而，如果你做一些别的开发，并不会让你觉得你背离了这门语言的设计初衷，特别是当你可以使用许多其他通用框架的时候。
PHP vs. Python: Lambda表达式
Lambda表达式一直是Python之于PHP的一项优势。它们非常简单灵活，开发者非常乐于使用。直到最近，PHP只有"create_function"函数，这让人觉得充其量只能是一种hack，并且是一种糟糕的实践（a bad practical joke the rest of the time）。这在PHP的最新版本中已经得到了改变；现在已经得到完全的支持。不过，开发者会使用吗？一些开发者几年以来一直避免使用这个功能。
PHP vs. Python: 调试和分析工具
PHP vs. Python: 到底是什么样的感觉？
PHP and Python are two of the world's most popular Web programming languages at the moment, and naturally both have distinct advantages and disadvantages. However, at IDG Australia — the publisher of Techworld Australia — we've been working on moving from PHP to Python over the last 18 months or so. Although we're yet to regret this decision, it would be foolish to think that switching from PHP is a simple decision to make.
PHP vs. Python: Language popularity
There is no question that PHP is extremely popular; in fact, it's currently the most popular open source programming language. There are always PHP developers available and there are always PHP jobs around. Right now on Seek.com.au there are some 3790 PHP jobs in Australia. And this demand generally translates into a large pool of developers that can be tapped into when you want to expand your team.
Python has never been that popular. However, counter intuitively, its lack of popularity compared to PHP can sometimes be a strength. Python developers may be somewhat rarer, but I've found they are often of much higher quality. While I'm sure there are some bad Python developers out there in the market, I have never had a job interview with one of them. I would love to be able to say the same thing about PHP developers.
PHP vs. Python: Language syntax
PHP has a very C-like syntax. Anyone who has been exposed to a C-like language gets it straight away. Curly braces and semi-colons work exactly as you'd expect and it feels familiar. I had no PHP experience when I got my first project based on the language. Barely two hours later I had read a small tutorial, found the bug I was looking for and a fix for my problem was being pushed into production.
Python isn't that easy. Making white space significant instead of using curly braces requires some adjustment to how you think about your code. This change will slow down people who have just switched to Python. With time this disadvantage goes away, however, as the Python syntax is usually extremely simple and in fact reads like pseudo-code.
PHP vs. Python: There's more than one way to do it
Many programmers when faced by a new project will tend to run ahead and code up a solution before thinking about what's required. Some languages pride themselves on offering as many ways as possible to solve problems. While PHP isn't as bad as Perl or Ruby in this respect, it will often offer many methods for you to do something. Python is not like that. If a task gets harder and harder to do, you know that you're going about it the wrong way. This will encourage junior developers to do things right the first time around.
PHP vs. Python: Web programming
PHP often feels like it's designed purely for creating Web pages, even if some people use it for other tasks. By default it's really an HTML template with code inserted in. Python, on the other hand, stands on its own two feet as a general purpose language. Programming for the web in Python involves choosing one of the web framework that gives you the functionality you want. If you're coding something different, however, it doesn't feel like you are working against the purpose of the language, specially as you can often use other general-purpose frameworks.
PHP vs. Python: Lambdas
Lambdas have long been an advantage of Python over PHP. They are so simple to create and flow so freely within the language that developers will want to use them when they are the right tool for the job. Until recently PHP only had the "create_function" function, which felt like a hack at best and a bad practical joke the rest of the time. This has changed in the latest version of PHP; there is now closure support. Will developers switch over, however? Some developers have now been avoiding this for years.
PHP vs. Python: Debugging and profiling tools
There are always promising links when you look for Python debugging and profiling tools using Google, but there always seem to be more available for PHP. The bigger developer ecosystem is an advantage here. That being said, I find myself reaching for this type of tool substantially less often when I'm coding with Python compared to in PHP. Maybe most people just don't need these kinds of tools when they are working with Python.
PHP vs. Python: But what does it feel like?
When listing individual reasons, it may seem like PHP has the upper hand. However, most people that I know that are comfortable in both languages will almost always choose to work in Python rather than in PHP. I don't know whether this is due to the simpler syntax and easier to write and understand code, but when I write something in Python, it's usually something I'm proud of that I want to show others. I can never say the same about things I write in PHP. This frame of mind can be explained quite simply. These two languages show up in the company cultures of those who use them. Facebook is in PHP. Google is in Python. Who do you want to be?
On a purely personal level, I'm left with the overriding feeling that PHP is like Play-Doh. You can make anything you want out of it, but at the end of the day it's still made out of Play-Doh.
Pascal Hakim is the director of IT and Development at IDG Australia.