[PHP vs Python vs JavaScript] for a web stack. Which one is recommended?

Pros of Python:

  • Elegant syntax, clear namespaces - which means good code-maintainability in long run.
  • Rich ecosystem and libraries (sqlalchemy, numpy, scipy, matplotlib).
  • Out of box support for everything .
  • Secure and easy to deploy websites With Django or Flask
  • Easy to build API’s and we can get rid of using raw queries in DB_layer

Cons of Python:

  • mysql library isn’t as good as mysqli of PHP.
  • Not easy to host via cpanel/plesk.

Pros of PHP:

  • Time tested and robust (CodeIgniter, Symfony, Laravel, etc. are written in that).
  • Easy to implement and host (cpanel/plesk widely supported).

Cons of PHP:

  • Tough syntax and usage (lack of standardization in function names, prone to messy code).
  • Difficult to understand namespaces.
  • sql injection and Phising attacks is very offen in PHP

Overall, I think python has more pros, whereas php has more cons, so my majority vote goes to the python side of my mind. However, I’d still like to know what most devs think here.



If you are all into security then go for python…

1 Like

So, will python be used for all services/portals of Swecha ?

Python is very easy to learn. We can train a lot of people to build portals for Swecha. Portals which can replace proprietary mediums.

Win-Win for volunteers & Swecha as well.


While PHP has grown since PHP5 to include more OOPS overall, it is much more advantageous to go with python. Especially with the async/await and functional constructs that are very well developed in python.

The language is much more standardized and the Django/Flask frameworks have good community support as well as documentation.


Yeah ! I can totally go with Python.

We have a need to build a stack based on python. Meant web development, Machine Learning, Data Science,QT Graphics, Kiwi android app development or HTML/PWA apps etcetra

1 Like

I think you missed about the Javascript, a powerful language for web development.

1 Like