Wednesday, 15 October 2014

What  are the advantages and disadvantages of Python over Java and PHP for web development?



Python is a general purpose programming language. As such, it can be used for almost any imaginable task except, perhaps, for highly intensive cpu bound applications, since it's currently not as fast as other languages (static compiled ones such as c or c++). Although if performance is critical, you still have many options and tools to help you get the most out of python. It's readable, very easy to learn and use, flexible and very expressive. All these characteristics make it a very productive language.


PHP is a server-side web scripting language. It's a single purpose, domain specific language, so it can't be compared to Python or Java. And if you want my opinion, it's not even as good as python in this field.
Java is, like python, a general purpose programming language. Since it's a statically typed, compiled (kinda) language, it's faster than any other scripting language (python, ruby, php, javascript, etc). However, this is, in my opinion, its only advantage.
Note that currently, there are  projects like PYPY which is a python implementation with a built-in just in time compiler that offers a great speedup over the main python implementation.
Python is specially great for startups, because it's highly productive and allows a more explorative way of coding which is awesome when prototyping or trying out new ideas. Often, these prototypes get shipped as the final, production version.


Java is much more verbose than python, and it takes a lot of boilerplate code to achieve even the simplest task.

There are other ongoing projects such as Pyston, another just in time implementation in the works.
And there's a plethora of tools to make regular python faster, so taking this into account, I'd say that python is the overall winner of these three options.


cc: http://www.quora.com/What-are-the-advantages-and-disadvantages-of-Python-over-Java-and-PHP-for-web-development

No comments:

Post a Comment