What are the differences between Perl, Python and PHP?

  • Thread starter Thread starter David D
  • Start date Start date
D

David D

Guest
The differences are vast and need books to explain. They can't be summed up in one or two sentences.

Update: There is very little difference in what they are used for - except that PHP is used less outside server side web programming then the others.
 
I've checked wikipedia and everything, but I'm just looking for a more straightforward, one or two sentence explanation of each. Any help would be appreciated!
I understand that programming languages are complex, but even a halfway decent programmer can explain the differences in use between a few languages. I'm not looking for differences in syntax or code, just what they are each used for.
 
Perl is a general purpose scripting language which is fabulous to know when you want to write quick one-liner scripts to do complex string transformations or other tasks. It has a wonderful development community and thousands of modules which make it very easy to do extremely complex things in a few lines. Perl will usually be slower than PHP or Python in a web application environment - but if you want to use Perl with Apache, then mod_perl is a blazing fast alternative. The syntax is extremely flexible, making it easy to be creative and shoot yourself in the foot.

PHP is just not very useful outside of web apps. The documentation for the hundreds of builtin functions is good, but it is often much more difficult to find and install quality PHP modules than in Perl and Python. The builtin functions make it very easy to do most web-related tasks where you would need to find the proper module in Perl and Python.

Python is also a general purpose language but it is often better suited for logic programming than convenience scripting. It is usually faster than PHP and Perl, can be compiled unlike the others, and has the most straightforward syntax. Some Python stuff seems to lack the quality documentation found in Perl which has made it a bit slower to learn than Perl for me (specifically, mod_python vs. mod_perl).
 
The differences are vast and need books to explain. They can't be summed up in one or two sentences.

Update: There is very little difference in what they are used for - except that PHP is used less outside server side web programming then the others.
 
Perl is a general purpose scripting language which is fabulous to know when you want to write quick one-liner scripts to do complex string transformations or other tasks. It has a wonderful development community and thousands of modules which make it very easy to do extremely complex things in a few lines. Perl will usually be slower than PHP or Python in a web application environment - but if you want to use Perl with Apache, then mod_perl is a blazing fast alternative. The syntax is extremely flexible, making it easy to be creative and shoot yourself in the foot.

PHP is just not very useful outside of web apps. The documentation for the hundreds of builtin functions is good, but it is often much more difficult to find and install quality PHP modules than in Perl and Python. The builtin functions make it very easy to do most web-related tasks where you would need to find the proper module in Perl and Python.

Python is also a general purpose language but it is often better suited for logic programming than convenience scripting. It is usually faster than PHP and Perl, can be compiled unlike the others, and has the most straightforward syntax. Some Python stuff seems to lack the quality documentation found in Perl which has made it a bit slower to learn than Perl for me (specifically, mod_python vs. mod_perl).
 


Write your reply...
Back
Top