Python v PHP: fair comparison?

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

    #16
    Re: Python v PHP: fair comparison?

    I've wrestled with this for quite a while, and I think
    that I've come up with a solution. Let the heavy lifting
    of the application be done with a back end python process.
    I was thinking that I might use cherrypy to sit there and
    wait for requests.

    Then, I would have PHP make calls to this back end process
    to get the content that it needs. This could be on any level
    from a simple datum from the database, or as complex as
    the HTML for the entire web page. I'm still trying to settle
    on a protocol (SOAP, CORBA?) but I think that it should be
    at the object level rather than simple posts to cherrypy.

    Anyway, even though not all web hosters have a reasonable
    python web framework installed, they will almost certainly
    allow you to run python programs. The PHP might eventually
    boil down to simple function calls that get content from
    the back end. Let python do all the work:

    <?php

    put_attendee_ma iling_info($id) ;
    list_cart_items ($id);

    ?>


    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
    >
    --
    Posted via a free Usenet account from http://www.teranews.com

    Comment

    • Luis M. González

      #17
      Re: Python v PHP: fair comparison?


      walterbyrd ha escrito:
      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.
      You are right.
      Although this is not a problem to me, because I just use bare-bones
      mod_python, with no framework on top of it.
      Not many people know that mod_python comes with its own built-in
      handlers suitable for different programming styles, such as PSP
      (similar to php) or publisher (M-V-C style).

      Luis

      Comment

      • Bruno Desthuilliers

        #18
        Re: Python v PHP: fair comparison?

        walterbyrd a écrit :
        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,
        Not even for a minor one. While one can write not-trivial applications
        in PHP, the kind of work this requires would greatly benefit from a real
        programming language (vs a Q&D web scripting language).
        but the
        barrier to entry is very low.
        >
        Ok. This observation is very specific to web development. Python is a
        general purpose programming language. And from this POV, it's IMHO much
        easier to learn. And not only because you don't need Apache to use it.

        Comment

        • Bruno Desthuilliers

          #19
          Re: Python v PHP: fair comparison?

          walterbyrd a écrit :
          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.
          Anyone that knows how to program and understand the http protocol is
          already a PHP developer.
          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.
          Then you'll find *very* few "Python developper" jobs.
          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.
          No, it's an ad for a sys-admin job.

          FWIW, I've been hired as a web developer - not as a PHP or Java or
          whatever specific language programmer. Python wasn't even on the "landry
          list". Then we had to hire another developer to help me on a Zope-based
          project. We didn't hired a "Zope developer", nor even a "Python
          developer" - we hired a young C/Perl hacker with almost no prior web
          programming knowledge. Why ? Because he obviously was the best
          *programmer* we could find. As a matter of fact, he managed to become a
          productive Zope/Python programmer in less than two weeks.
          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.
          There are companies that believe that there are such things as "PHP
          programmer", "Java programmers", etc. And there are companies that know
          the difference between a programmer and a code-monkey. The first one
          will ask for 10+ years of experience on a techno that is less than 5
          years old. The other will know a good coder when they meet one. Guess
          where are most 'Python programmers' working ?
          Of course, at best, that only shows the demand part of the equation.
          Not even.
          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.
          >
          Anyone that knows how to program and understand the http protocol is
          already a PHP developer.

          Comment

          • Bruno Desthuilliers

            #20
            Re: Python v PHP: fair comparison?

            Michael Torrie a écrit :
            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.
            From a purely technical POV, you're of course right. But PHP has been
            hacked (nobody in it's own mind would pretend it has ever been
            'designed') for web programming, and since the language by itself is
            totally and definitively braindead, using it for anything else is either
            masochism or lack of knowledge of better solutions. Heck, even Perl is
            better for pure admin/scripting tasks.
            Most of my standalone, command-line scripts for
            manipulating my unix users in LDAP are written in PHP,
            Yuck.
            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/
            As a matter of fact, while PHP *can* be used for GUI and CLI apps,
            you'll have hard time finding non-web PHP-based projects... OTOH, you'll
            find Python everywhere, from sys-admin scripts to full-blown web
            application servers to rich GUI clients. There must be a reason...

            Comment

            • Bruno Desthuilliers

              #21
              Re: Python v PHP: fair comparison?

              walterbyrd a écrit :
              Michael Torrie wrote:
              >
              >
              >>Absolutely false. Most of my standalone, command-line scripts for
              >>manipulatin g 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.
              Perl is a scripting language. By 'design'. It's meant to be a better
              sh+sed+awk. Python is a general purpose programming language meant to
              fill the gap between shell scripts and C programs. So Perl is obviously
              a better scripting language than Python. The problem is that Q&D
              sys-admin scripts tend to become full-blown apps - and then, Perl starts
              to suck.

              Comment

              • Bruno Desthuilliers

                #22
                Re: Python v PHP: fair comparison?

                walterbyrd a écrit :
                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.
                Yes. Neither Apache 2.0 nor mod_python 3.x nor Python 2.4 are really
                bleeding edge, you know.
                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.
                You mean there are web hosting companies that are still using Apache
                1.3.x ?

                C'mon, let's be serious. I just ordered a dedibox - a small dedicated
                web server - for my personal use. It's only 30 euros a month, you know...

                Comment

                • Carl Banks

                  #23
                  Re: Python v PHP: fair comparison?

                  walterbyrd wrote:
                  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.
                  Probably because PHP is so bug-prone and man-inefficient that a small
                  website occupies a programmer's whole time, whereas a single Python (or
                  Ruby, or Perl, or even Java) programmer could manage several web sites.

                  (If by "probable" I mean "wishful thinking", that is :)


                  Carl Banks

                  Comment

                  • Gabriel Genellina

                    #24
                    Re: Python v PHP: fair comparison?

                    At Wednesday 15/11/2006 21:28, Bruno Desthuilliers wrote:
                    >Michael Torrie a écrit :
                    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.
                    >
                    From a purely technical POV, you're of course right. But PHP has been
                    >hacked (nobody in it's own mind would pretend it has ever been
                    >'designed') for web programming, and since the language by itself is
                    >totally and definitively braindead, using it for anything else is either
                    masochism or lack of knowledge of better solutions. Heck, even Perl is
                    >better for pure admin/scripting tasks.
                    Someone here (= at work) needed to write some PDF
                    reports, to be run from a bunch of ini-like
                    files. Without much research nor analysis nor
                    thinking nor approval, he said "let's use this
                    php library!". Surely the reports came in a few days. But:
                    - another dependency was added to the project
                    - the .ini format -which was suposed to be an
                    internal implementation detail- is now part of
                    the public interfase to the report generator
                    - a lot of PHP code duplicates the original class hierarchy (in delphi)
                    - php sucks :)

                    Of course there are a lot of unrelated issues
                    here, but I think that it's such a braindead
                    language which turns people into braindead programmers :)


                    --
                    Gabriel Genellina
                    Softlab SRL

                    _______________ _______________ _______________ _____
                    Correo Yahoo!
                    Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
                    ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar

                    Comment

                    • Gabriel Genellina

                      #25
                      RE: Python v PHP: fair comparison?

                      At Wednesday 15/11/2006 22:11, bruce wrote:
                      >interesting ongoing thread...
                      >
                      >i've seen a number of these over the years.. my language is better than your
                      >language!!
                      >
                      >i'm sure this question on the php list would have findings/results that are
                      >essentially opposite of what is being discussed here!
                      Sure. But after you realize that a language is just a tool to
                      complete a task, most of the discussions are meaningless. The
                      original post didn't say "python is better than php", and I think the
                      comparison is rather fair.


                      --
                      Gabriel Genellina
                      Softlab SRL

                      _______________ _______________ _______________ _____
                      Correo Yahoo!
                      Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
                      ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar

                      Comment

                      • walterbyrd

                        #26
                        Re: Python v PHP: fair comparison?


                        Bruno Desthuilliers wrote:
                        walterbyrd a écrit :
                        You mean there are web hosting companies that are still using Apache
                        1.3.x ?
                        >
                        Practically all web-hosters still use Apache 1.3.x. Certainly all of
                        the lower priced hosters.
                        C'mon, let's be serious. I just ordered a dedibox - a small dedicated
                        web server - for my personal use. It's only 30 euros a month, you know...
                        What if I only need 25mb of space? I can that with a PHP hoster for $10
                        a year. That is about 1/36th the price that you posting about.

                        Maybe you don't mind paying 30 euros a month, but a lot others do.

                        Comment

                        • walterbyrd

                          #27
                          Re: Python v PHP: fair comparison?


                          Gabriel Genellina wrote:
                          - php sucks :)
                          I think that it's such a braindead
                          language which turns people into braindead programmers :)
                          >
                          >
                          In fairness, a lot of very serious work is done in PHP. I think yahoo
                          and other major web-sites use php.

                          I have issues with PHP as well. They will break backward compatibility
                          on a whim, and it is an ugly language - especially when mixed with
                          html. But, PHP does have it's streaths, and Python is not without it's
                          weaknesses.

                          Comment

                          • Cameron Laird

                            #28
                            Re: Python v PHP: fair comparison?

                            In article <1163559359.010 787.185840@m73g 2000cwd.googleg roups.com>,
                            Luis M. González <luismgz@gmail. comwrote:

                            Comment

                            • James Cunningham

                              #29
                              Re: Python v PHP: fair comparison?

                              On 2006-11-15 20:59:26 -0500, "walterbyrd " <walterbyrd@ina me.comsaid:
                              >
                              Bruno Desthuilliers wrote:
                              >walterbyrd a écrit :
                              >
                              >You mean there are web hosting companies that are still using Apache
                              >1.3.x ?
                              >>
                              >
                              Practically all web-hosters still use Apache 1.3.x. Certainly all of
                              the lower priced hosters.
                              Not true. Dreamhost, at least, uses Apache 2.
                              >
                              >C'mon, let's be serious. I just ordered a dedibox - a small dedicated
                              >web server - for my personal use. It's only 30 euros a month, you know...
                              >
                              What if I only need 25mb of space? I can that with a PHP hoster for $10
                              a year. That is about 1/36th the price that you posting about.
                              >
                              Maybe you don't mind paying 30 euros a month, but a lot others do.
                              Of course, you can't get $10 a year plans on Dreamhost. But with deals
                              you can get it down to about that low, at least for the first year. I
                              suppose I'm lucky enough not to miss $8 a month otherwise.

                              Best,
                              James

                              Comment

                              • Steve Holden

                                #30
                                Re: Python v PHP: fair comparison?

                                bruce wrote:
                                ummm bruno...
                                >
                                you don't 'need' apache to run php.
                                >
                                in fact, although i'm from the old hard c/c++ world.... way before web apps,
                                i haven't really found much for most general apps (not ui/not threaded
                                stuff) that php can't do..
                                You simply haven't been looking hard enough.

                                regards
                                Steve
                                --
                                Steve Holden +44 150 684 7255 +1 800 494 3119
                                Holden Web LLC/Ltd http://www.holdenweb.com
                                Skype: holdenweb http://holdenweb.blogspot.com
                                Recent Ramblings http://del.icio.us/steve.holden

                                Comment

                                Working...