5

Some say that Python is way better and fast than PHP. Is that true??

Comments
  • 4
    I don't know how it compares in speed, but Python's syntax is vastly cleaner and easier.
  • 0
    Python is quite different than PHP. Does Python Support Real time server calls?
  • 0
    You mean can it make HTTP requests? Doesn't everything?
  • 0
    No No No! HTTP requests can be made using AJAX also! i m asking wether python does make up the HTTP requests without ajax?
  • 2
  • 2
    Sure, I guess. Python isn't structured like PHP. It isn't embedded directly into webpages. It's more general. PHP is mostly intended to be used for web servers. Python can do that and other things.
  • 5
    @yashlalwani Thats up to you, python doesn't know what a web request or ajax is (There are libraries and frameworks for python that do, or you could write your own that works in whatever way you feel is appropriate).

    In general python is slightly slower than PHP(7) but for complex web applications it tends to be faster anyway since it can keep the application data between requests (unless you use a retarded web framework that starts from scratch on each request)
  • 2
    Python is more general purpose than Php where Php is aimed at server side.

    Not sure Python is faster though.
  • 0
    I would say, if you develop for the web, stay with PHP (7). It is intended for that.
  • 3
    @tracktraps if you develop for the web as it was in 2004 then yes, PHP7 is made for that.
  • 0
    @ItsNotMyFault Don't mix frontend with backend. PHP7 is absolutely fine for current and future projects. Most things happen anyway on the client side. (javascript, html5, css, ...)
  • 6
    @ItsNotMyFault You do realise PHP 7 came out about a year ago so it can't possibly be designed for 2004.

    By all means criticize PHP but at least do it with the level of intellect expected from developers.
  • 3
    @nblackburn Absolutely right. There are just people who hate PHP. Simply so, without reason.
  • 2
    @nblackburn couldn't have said better myself. The comments regarding php and php7 are just ignorant. I've stopped acknowledging them.
  • 3
    @nblackburn
    The share nothing / start each request from zero was sensible when websites were simple and "everyone" used shared hosting.

    The modern web however doesn't work like that, it is built around persistent backend applications (usually running in containers)

    PHP7 did not change anything in that regard, it made the language a bit less painful to use and improved performance slightly but the fundamental problem remains.

    The closest you can get to a modern web backend with PHP is probably ReactPHP (And that is a pretty major hack that gets around the outdated web portion of PHP by running as one or more commandline processes(usually monitored and restarted as needed by a python script ....) that uses the low level socket library to manually handle incoming connections and requests. (Basically the same way web frameworks for C work except C is actually better suited for it)
  • 1
    @ItsNotMyFault ill accept the first point but the rest is bollocks.
Add Comment