For the Web:
Bottom line:
PHP is easier to learn and has more support for database access due to it's headstart as a Web development platform.
However Python has passed it as a general purpose language. See Languages.
Python is a better language. Encourages better code and is general purpose.
Other:
PHP is the de-facto language for the web: Majority of the popular web frameworks (Wordpress, Drupal, Joomla, Zend, CodeIgniter, OSCommerce) are built on PHP. Which also makes it very easy to find a web developer who knows PHP.
Python has Django a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
There are database access layer limitations in Python.
The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP.
See:
PHP vs Ruby vs Python: Unbiased Comparison in 2016 |
10 Reasons Why Python Scores Over PHP for Web Development |
General Comparison:
PHP:
- Forgiving: PHP is one of the most 'freeform' languages I have used, probably comparable only to Javascript.
- Easier learning curve: You can quickly start coding in PHP with a basic understanding or experience of programming. This was the main purpose PHP was created to serve. This also helps in faster development.
- Hobbyist-compliant: The code doesn't need to be elegant for it to work. I think this is the biggest reason for it to have become the most popular web development language. You can cook up some code in a hurry, and it works.
- Open source and communities: There is a huge community and open source projects that use PHP. Makes it easy to get support if you run into a roadblock.
- De-facto language for the web: Majority of the popular web frameworks (Wordpress, Drupal, Joomla, Zend, CodeIgniter, OSCommerce) are built on PHP. Which also makes it very easy to find a web developer who knows PHP.
- Hosting support: Because of popularity, PHP hosting is supported by almost every provider out there.
- PHP 5 is actually a huge improvement over the versions before in terms of language design etc.
- PHP has Kohana, Symfony, Codeigniter and Zend frameworks for web development.
Python:
- Syntax and standard library: I LOVE the readability of Python syntax. The standard Python library ships with a great set of tools and utilities.
- General purpose: Python can be run on the servers, to build applications and in many other places.
- Elegant: Python has an elegant language design which makes it much easier to write great code.
- Unicode support: Python has great support for Unicode.
- Modular and definitive: Python is less quirky compared to PHP.
- Python has Django a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
.Source: Bhashkar Sharma at (7) Which is better, PHP or Python? Why? - Quora
Source: Code Wars: Ruby vs Python vs PHP | udemy.com
Links:
last updated 16 Apr 2016
|