1. Home
  2. Computing & Technology
  3. Python

What is Python?

By Al Lukaszewski, About.com

4 of 7

How Does Python Compare to PHP?

As it is another programming language, the commands and syntax of Python differ from other interpreted languages. PHP is increasingly displacing Perl as the lingua franca of down-and-dirty web development. However, more than either PHP or Perl, Python is much easier to read and to follow.

At least one downside which PHP shares with Perl, however, is its squirrely code. Because of the syntax of PHP and Perl, it is much harder to code programs that exceed 50 or 100 lines. Python, on the other hand, has readability hard-wired into the very fabric of the language. The readability of Python makes such programs easier to maintain and extend, as well.

While it is starting to see more general usage, PHP is, at heart, a web-oriented programming language. The name itself stands for "PHP: Hypertext Processor", suggesting the fact that it was meant to output web-readable information, not handle system-level tasks. This difference is exemplified in the fact that one can develop a web server in Python that can understand PHP (e.g., Zope), but one cannot develop a web server in PHP that can understand Python.

Finally, Python is object-oriented. PHP is not. This has significant implications for the readability, maintability, and scalability of programs written in each.

4 of 7

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Beginning Python
  5. Python Compared - How Does Python Compare to PHP?

©2008 About.com, a part of The New York Times Company.

All rights reserved.