Question:
python vs PHP? need some technical and daily life usage reviews?
faisal9550284
2017-10-05 11:00:57 UTC
python vs PHP? need some technical and daily life usage reviews?
Seven answers:
?
2017-10-07 09:42:05 UTC
PHP is easy to learn as compare to python
Todd
2017-10-07 00:24:00 UTC
Python is more versatile and in my opinion easier to learn. On top of that, it has a huge resource of libraries. I prefer Ruby for everyday tasks, but I would definitely pick Python over PHP. I played with PHP. I found it to be much less than I expected for any task. It doesn't have features that I want.
daisy
2017-10-05 16:23:19 UTC
PHP is a language that's made for the web. You can make GTK and CLI applications with PHP, but it's mainly used for websites. Python is used for a lot of stuff like websites, webservers, game frameworks, desktop and CLI application, IDEs and a lot more. There's also a huge difference in the syntax.
husoski
2017-10-05 14:12:05 UTC
Modern use of PHP tends to avoid the "embedded in HTML" approach, generating the whole document programmatically, but the application area for PHP is almost entirely restricted to constructing a response to an HTTP request in a web server.



Python was originally designed for scripting use, that's true, but that's also 1990's news. In this century, Python is a powerful, general-purpose programming language and its applications go well beyond "scripts...for local use." Two examples of that are the Django framework, which alone covers the entire application area of PHP, and the reference implementation of the bittorrent peer-to-peer file sharing protocol--both written in Python and both far from local scripting.



Python has a much broader application domain; but if you're going to compare the two then the only common ground they have is in the server side of a web application. Right now, PHP implementations outnumber everything else combined (ASP.NET, Java, Node.JS, Django, Ruby-on-rails, etc.) It's the P in "LAMP stack" and one of the things that made cheap shared web hosting practical.



If you're going to be creating small websites hosted on shared servers, PHP is hard to beat. Personally, I don't care much for the language, but a decent programmer should be able to work in any language and PHP is the most practical choice in this domain. Django, Rails and Node.JS aren't available everywhere and don't have the volume of ready-to-run code that PHP does. There's not a lot of money to be made per-site, so you need to be using what's already written if you're not going to be reinventing the bankruptcy.



For larger, higher volume sites--developed by a team probably, and run on dedicated servers (or VPS at the very least)-- then you have more freedom to choose something that fits the team as much as it does the application. Personally, I'd take a long, hard look at Python/Django...but most web developers would probably choose JavaScript/Node.JS as the first thing to look at after PHP.
joe
2017-10-05 13:02:14 UTC
Glad to know!
Uneeb
2017-10-05 11:12:51 UTC
PHP is good for web development as comapre to Python. where for Networking APP Python is best.
?
2017-10-05 11:06:01 UTC
Python is for scripts to be run locally, for local use. It can do many different things, including relatively complex programs and high-performance computing with a decent efficiency.

PHP is solely for server-side interpretation of scripts embedded in HTML, and those scripts are typically extremely elementary. It often interfaces between the HTTP server and in SQL database.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...