By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

Python vs PHP

Is Python better or faster than PHP, what are some differences?

Edited: 2012-03-02 10:50

Now that Brugbart has its first resources on Python, perhaps its time to talk about some differences between Python and PHP.

Python does promote a stricter coding style. For instance, where PHP allows you to escape in and out of PHP between HTML elements, using <?php and ?>, Python doesn't provide the same functionality. Instead Python is using HTML templates, and filling the templates out with content, only to return the whole thing as one large string.

Python vs PHP

Generally, as with other programming languages, i wouldn't label one as being better then another. PHP gets the job done, it may be dirtier at times, but then again, its your own responsibility to keep your code clean.

Python is a bit harder to learn, if you are used to doing things in PHP. But this is largely due to the lack of good Tutorials, hopefully Brugbart will get more Python Tutorials in the future.

There is a comparison hosted at the Python Wiki, you may also want to check that out for more information.