Python v PHP: fair comparison?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • walterbyrd

    #1

    Python v PHP: fair comparison?

    I don't know if this is a fair comparison or not. Any comments
    appreciated.

    - Python is more readable, and more general purpose
    - PHP has awful backward compatibility
    - PHP has a lower barrier to entry
    - Most inexpensive web-hosters support PHP, but not Python
    - PHP has far more pre-writen scripts available
    - Newer versions of mod_python require Apache 2.0, which few hosters
    have
    - There is more demand for PHP developers, than Python developers

  • Bjoern Schliessmann

    #2
    Re: Python v PHP: fair comparison?

    walterbyrd wrote:
    - PHP has a lower barrier to entry
    Which kind of barrier do you mean -- syntax, availability, ...?

    Also from what I know of PHP, language and API seem more unstable
    and inhomogenous. CMIIW.

    Regards,


    Björn

    --
    BOFH excuse #219:

    Recursivity. Call back if it happens again.

    Comment

    • Larry Bates

      #3
      Re: Python v PHP: fair comparison?

      walterbyrd wrote:
      I don't know if this is a fair comparison or not. Any comments
      appreciated.
      >
      - Python is more readable, and more general purpose
      - PHP has awful backward compatibility
      - PHP has a lower barrier to entry
      - Most inexpensive web-hosters support PHP, but not Python
      - PHP has far more pre-writen scripts available
      - Newer versions of mod_python require Apache 2.0, which few hosters
      have
      - There is more demand for PHP developers, than Python developers
      >
      For the most part you wouldn't ever thing about writing data
      conversion programs, GUI applications, Windows services, COM+ objects,
      Linux daemons, simple scripts, socket server/client applications,
      etc. in PHP (but all can be done in Python). Web apps are just one of
      the many applications that Python can tackle. PHP is normally
      relegated to dynamic web page creation and database interfacing of
      a web application. I've never seen it promoted as a language
      that can be used to develop a standalone non-web browser based
      application (but I'm sure someone will tell me that it can be used
      that way ;-).

      I agree that you can use PHP to do some basic Web apps more
      quickly and with more general availability in PHP than Python.
      I think there is a reason that Java and Python are used to power
      the larger application frameworks that I see (e.g. WebSphere,
      WebLogic, Zope, etc.).

      I find many hosting companies that have mod_python now (this
      wasn't the case a couple of years ago). Hosting costs have
      dropped so much during that time that getting Python doesn't
      cost much (if any) extra.

      I'd be surprised if there was more demand for PHP developers
      than Python developers. Google lists 51 PHP jobs and 168
      Python jobs in their internal jobs database (I just did a
      quick search).

      -Larry

      Comment

      • martdi

        #4
        Re: Python v PHP: fair comparison?

        I'd be surprised if there was more demand for PHP developers
        than Python developers. Google lists 51 PHP jobs and 168
        Python jobs in their internal jobs database (I just did a
        quick search).
        Yes, but Google is the company that hired Guido, and that does most of
        it's dev in python.

        Looking at other companies yields different results:

        Workopolis:
        PHP 120
        Python 36

        Monster.ca:
        PHP more than 1000
        Python 976

        Comment

        • Luis M. González

          #5
          Re: Python v PHP: fair comparison?


          - Python is more readable, and more general purpose
          Yes, php is only for web.
          On the other hand, Python is a general purpose language and it can be
          used for nearly anything you may want to do.
          - PHP has awful backward compatibility
          Yes. And it's also an ugly language to work with.
          - PHP has a lower barrier to entry
          I don't think it is any easier than python. Not even to begin with.
          - Most inexpensive web-hosters support PHP, but not Python
          Sad but true.
          - PHP has far more pre-writen scripts available
          For web projects, perhaps.
          But I'm sure you can do everything better with python, especially with
          the new crop of web frameworks (Django, Turbo Gears, etc...).
          - Newer versions of mod_python require Apache 2.0, which few hosters
          have
          You can also get alder versions of mod_python. What's the problem?
          - There is more demand for PHP developers, than Python developers
          So you want to be a web developer?
          Then look no further. Learn python and go kick php developers asses in
          the market place.
          There are thousands of php developers out there. Do you want to be just
          one more?
          I'd rather learn something newer, and much more powerful.
          And once you get a job, you will do everything better and faster than
          the others, your quality will stand up from the rest and so your
          reputation.
          Then there will be more demand for "your skills".

          Comment

          • Michael Torrie

            #6
            Re: Python v PHP: fair comparison?

            On Tue, 2006-11-14 at 18:55 -0800, Luis M. González wrote:
            >
            - Python is more readable, and more general purpose
            >
            Yes, php is only for web.
            Absolutely false. Most of my standalone, command-line scripts for
            manipulating my unix users in LDAP are written in PHP, although we're
            rewriting them in python.

            Although I can't think of a single app written in php that's not web-
            based (other than standalone scripts I have written), there are up-to-
            date php bindings for GTK: http://gtk.php.net/

            Michael

            On the other hand, Python is a general purpose language and it can be
            used for nearly anything you may want to do.
            >
            - PHP has awful backward compatibility
            >
            Yes. And it's also an ugly language to work with.
            >
            - PHP has a lower barrier to entry
            >
            I don't think it is any easier than python. Not even to begin with.
            >
            - Most inexpensive web-hosters support PHP, but not Python
            >
            Sad but true.
            >
            - PHP has far more pre-writen scripts available
            >
            For web projects, perhaps.
            But I'm sure you can do everything better with python, especially with
            the new crop of web frameworks (Django, Turbo Gears, etc...).
            >
            - Newer versions of mod_python require Apache 2.0, which few hosters
            have
            >
            You can also get alder versions of mod_python. What's the problem?
            >
            - There is more demand for PHP developers, than Python developers
            >
            So you want to be a web developer?
            Then look no further. Learn python and go kick php developers asses in
            the market place.
            There are thousands of php developers out there. Do you want to be just
            one more?
            I'd rather learn something newer, and much more powerful.
            And once you get a job, you will do everything better and faster than
            the others, your quality will stand up from the rest and so your
            reputation.
            Then there will be more demand for "your skills".
            >

            Comment

            • Luis M. González

              #7
              Re: Python v PHP: fair comparison?

              >Yes, php is only for web.
              >
              Absolutely false. Most of my standalone, command-line scripts for
              manipulating my unix users in LDAP are written in PHP, although we're
              rewriting them in python.
              >
              Although I can't think of a single app written in php that's not web-
              based (other than standalone scripts I have written), there are up-to-
              date php bindings for GTK: http://gtk.php.net/
              >
              Michael
              Fair enough, this has been possible due to the enormous popularity of php.
              You can also hit a nail with your shoe instead of using a hammer, and if you
              try hard you may even succeed. You can also digg a a grave with a spoon
              instead of a shovel, and after a couple of days you'll be finished.
              You may be able to use php to create a stand alone app, but php was created
              with the solely purpose of being a tool for creating dynamic web sites.
              And you have to admit that using php for a non-web app is like trying to fit
              a a square into a round hole.
              Php is no more than a simplified C-ish language, dynamically typed with a
              lot of functions aimed at web tasks. Without these built-in functions,
              there's little you can do with it in your web apps.
              On the otehr hand, you don't need a thousand built-in functions in python
              for achieving every single task on a web site. You just write them, often
              with just a couple of lines, because the language is that flexible an
              consice.
              You don't have to remember each and every function for every task, this is
              ridiculuous.

              I think that even as a general purpose language, python is still much more
              adecuate, fast, fun and flexible than php for building web apps.

              Luis





              Comment

              • Hendrik van Rooyen

                #8
                Re: Python v PHP: fair comparison?

                Olexandr Melnyk wrote:

                PHP has a lower barrier to entry
                I don't think so. Python has more intuitive syntax for beginners and is one of
                the best choices for the first programming language to pick up.

                I second this - before discovering Python (in a GSM module's guts) - I was being
                steered in the direction of PHP by a friend - and I resisted, kicking and
                screaming, as I found the syntax weird - I believe its not called Personal Home
                Page for nothing...

                - Hendrik

                Comment

                • walterbyrd

                  #9
                  Re: Python v PHP: fair comparison?

                  Luis M. González wrote:
                  the new crop of web frameworks (Django, Turbo Gears, etc...).
                  >
                  - Newer versions of mod_python require Apache 2.0, which few hosters
                  have
                  >
                  You can also get alder versions of mod_python. What's the problem?
                  The problem is that the system requirements for django and turbogears
                  are sky-high. I think Django requires Apache 2.0 (and maybe mod_python
                  3.x), and CherryPy (part of turbogears) requires Python 2.4. If you are
                  developing for a hosted environment, this can be a big problem. Few
                  enough hosters provide python to begin with, then add to that such
                  requirements as apache 2.0 - and you left with almost nothing.

                  Comment

                  • walterbyrd

                    #10
                    Re: Python v PHP: fair comparison?


                    Larry Bates wrote:
                    I'd be surprised if there was more demand for PHP developers
                    than Python developers.
                    Prepare to be surprised. From what I have seen demand for PHP
                    developers is off-the-scale higher than demand for Python developers.

                    If you search the job boards, then -IMO- it is only fair to not include
                    jobs where the language is listed as an also-ran. For example a typical
                    sys-admin job will list about 24 skills, and python is often thrown
                    into the landry list. To my way of thinking, that is not really an ad
                    for a python developer.

                    Trying to be as fair as I can be, my research shows that demand for
                    developers where PHP is the primary is *far* higher than jobs where
                    Python is the primary skills.

                    Of course, at best, that only shows the demand part of the equation.
                    There is also the supply side to consider. From what I have seen for
                    salary offers for PHP developers, it may be fair to say that PHP
                    developers are a dime a dozen.

                    Comment

                    • walterbyrd

                      #11
                      Re: Python v PHP: fair comparison?


                      Bjoern Schliessmann wrote:
                      walterbyrd wrote:
                      >
                      - PHP has a lower barrier to entry
                      >
                      Which kind of barrier do you mean -- syntax, availability, ...?
                      >
                      Putting php into a web-site is as easy as throwing some php code into a
                      my html file, and maybe giving the file a php extension. I can get php
                      hosting for $10 a year easy.

                      This may not be what you want for a major developement project, but the
                      barrier to entry is very low.

                      Comment

                      • Paul Boddie

                        #12
                        Re: Python v PHP: fair comparison?

                        walterbyrd wrote:
                        >
                        The problem is that the system requirements for django and turbogears
                        are sky-high. I think Django requires Apache 2.0 (and maybe mod_python
                        3.x), and CherryPy (part of turbogears) requires Python 2.4. If you are
                        developing for a hosted environment, this can be a big problem. Few
                        enough hosters provide python to begin with, then add to that such
                        requirements as apache 2.0 - and you left with almost nothing.
                        I guessed that this was what you meant by "PHP has a lower barrier to
                        entry", even though others chose to interpret that in the context of
                        how easy or consistent the technology would seem to be in comparison
                        with Python. While it's true that PHP seems to be widely available, and
                        the newcomer can probably get immediate results by just publishing a
                        few files, the availability of relatively inexpensive virtual server
                        hosting seems to undermine claims that no-one supports Python together
                        with a modern selection of server programs.

                        I've been tempted to get some "dynamic" hosting at some point, and the
                        major difference between now and the last time I looked into this
                        (possibly about three or so years ago), is that back then you had to
                        spend a fair amount of money to get anything other than an
                        inconveniently accessible CGI directory requiring a version of
                        cgipython that could run on the inconveniently chosen version of
                        FreeBSD so beloved of certain hosting providers. Now, you can get a
                        virtual server populated with your own GNU/Linux distribution, or if
                        that sounds like too much work, there's a choice of hosting providers
                        that support Python plus certain servers "out of the box".

                        Things seem to have moved on, and very much for the better, too.

                        Paul

                        Comment

                        • walterbyrd

                          #13
                          Re: Python v PHP: fair comparison?


                          Michael Torrie wrote:
                          Absolutely false. Most of my standalone, command-line scripts for
                          manipulating my unix users in LDAP are written in PHP, although we're
                          rewriting them in python.
                          >
                          I would say that you are one of very few who use PHP for sys-admin
                          tasks - and even you have switched to Python. In general, it does not
                          seem to me that PHP has caught on as a sys-admin language.

                          However, as sys-admin scripting langanges go, I would also say that
                          Python is far less popular than butt-ugly Perl. Again - just based on
                          what I've seen.

                          Comment

                          • Andy Dingley

                            #14
                            Re: Python v PHP: fair comparison?


                            walterbyrd wrote:
                            I don't know if this is a fair comparison or not.
                            Who cares? Anything involving PHP is a "billion flies can't be wrong"
                            type of statement.

                            I agree completely with your observation about PHP's lower cost of
                            access. This is ostensibly a good thing, but it also means that every
                            software-ignorant newbie dives straight into PHP and ten minutes later
                            they're a guru. The average quality of PHP developers is rock-bottom
                            and the average quality of PHP code is about the same. I don't like the
                            language either, but it's the use PHP is put to that spoils most of it,
                            more than language features itself.

                            Comment

                            • James Cunningham

                              #15
                              Re: Python v PHP: fair comparison?



                              On 2006-11-15 10:47:07 -0500, "Demel, Jeff"
                              <Jeff.Demel@Jav elinDirect.coms aid:
                              [...]
                              That's true, but I was lucky enough to find webfaction.com for python
                              hosting, including Django. Good prices and they know Python. I think
                              they used to be python-hosting.com or something.
                              >
                              -Jeff
                              Dirt-cheap Dreamhost also offers Python with Django (as well as Ruby
                              with Rails), though I haven't used those capabilities so I can't judge
                              how good the environment is. I suspect it isn't that great. The people
                              at Dreamhost are great; the service itself is - at best! - unreliable.

                              Best,
                              James

                              Comment

                              Working...