Why PHP is so much more popular for web-development

Discussion in 'Python' started by Bruno Desthuilliers, Jul 22, 2007.

  1. walterbyrd a écrit :
    > On Jul 25, 12:40 pm, Carsten Haese <> wrote:
    >
    >
    >>What exactly could Python learn from PHP?

    >
    >
    > Remember, I'm a noob, I'm not trolling.
    >
    > When I posted "Python" I meant the Python web-developement world. In
    > particular, python frameworks, like CherryPy, have requirements that
    > are not realistic for most shared hosting plans.
    >
    > Maybe I'm wrong, but I often get the idea that those who develop
    > python frameworks don't give a thought to the realities of shared
    > hosting. They seem to think that everybody has complete control over
    > the server. Things are very different in the PHP universe.


    Fact is that most of the Python developpers working in this domain are
    doing it in a professional context - which usually implies dedicated
    servers, or at least professional-quality hosting. To make a long story
    short, most of Python-based web development solutions compete with Java,
    not with PHP.

    > To use codeignitor as an example, again. On the "why codeignitor"
    > part of the welcome page you will find:
    >
    > ---
    > CodeIgniter is right for you if...
    > * You need broad compatibility with standard hosting accounts that run
    > a variety of PHP versions and configurations.
    > * You want a framework that requires nearly zero configuration.
    > * You want a framework that does not require you to use the command
    > line.
    > ---
    >
    > I don't seem to see Python frameworks using those sorts of selling
    > points.


    Hopefully not - except perhaps for the second point. Being a
    professional web developer implies a knowledge that is far beyond what
    one can expect of the typical PHP user.

    > Posting as a noob, who is struggling to get django configured
    > on dreamhost, I gotta tell 'ya: those selling points look awfully
    > attractive.


    Posting as a web developer, I dont give a damn about points #1 and #3.
    wrt/ point #2, I expect my tools to be configurable, but with sensible
    defaults.

    > The point is: PHP framework makers are very considerate of the
    > realities of shared hosting.


    You mean: of grand-public, low-price shared hosting.

    And yes, that's true: most PHP frameworks are for non-programmers.

    > Python framework makers don't seem to
    > give it a thought.


    They do. But the issue here is that most low-budget share-hosting
    providers just don't give a damn about Python anyway (at best you'll
    have cgi with a prehistoric Python version), so there's just no reason
    to try to be competitive here. Either you are a casual user with 101 web
    development skills trying to set up your personal home page (ever
    wondered what PHP stands for ?), and then PHP is quite enough for you,
    or you are doing professional-quality web development, and then you know
    how to use a unix command line, configure your system and choose the
    appropriate hosting solution (FWIW, small dedicated server are nowadays
    dirt cheap).

    > Just maybe, that's something that Python could
    > learn from PHP.


    I don't think so.
     
    Bruno Desthuilliers, Jul 22, 2007
    #1
    1. Advertising

  2. SamFeltus a écrit :
    > PHP is just a more inclusive community. The PHP community is more
    > concerned with the casual user and the end user. This is PHP's core
    > strength, and one of Python's core weaknesses. The Python community
    > would be wise to adopt PHP's concern for the end user.


    This assertion is at least debatable. It's true that Python is not as
    easy to get started withn as it was some 7 years ago, and it's true that
    some of use here are probably paying less and less attention to FAQs -
    but what, they are FAQs, so it should be easy to find some answers.
    Still, this NG and the overall Python community are amongst the most
    tolerant and newbie-friendly around. Even some of the greatest masters
    here are spending time answering to 101 questions on a regular basis.

    > That being said, I don't think you will find PHP easier than Python.
    > I think the reverse is true, except in the simplest cases.


    Mmm... I certainly do find python easier, but I'm obviously biased since
    I had time to learn it and know most of the gotchas. The problem might
    be very different for newcomers, specially for the
    'programming-illiterate' ones. I surely spend less time checking the doc
    with Python than with PHP - thanks to good design, good naming,
    consistency, REPL and in the worst interactive doc, all things missing
    in PHP. OTHO, PHP is so basically braindead that it doesn't requires
    anyone to be able to cope with the higher-level abstractions that make
    Python so powerful.
     
    Bruno Desthuilliers, Jul 23, 2007
    #2
    1. Advertising

  3. Bruno Desthuilliers

    walterbyrd Guest

    "Once you start down the Dark path, forever will it dominate your
    desiny. Consume you, it will."
    - Yoda

    I'm fairly new to web-development, and I'm trying out different
    technologies. Some people wonder why PHP is so popular, when the
    language is flawed in so many ways. To me, it's obvious: it's because
    it's much easier to get started with PHP, and once somebody gets
    started with a particular language, that person is likely to stay with
    that language.

    Before you can even get started with Python web-development, you have
    to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
    FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
    difficult part of getting django to work. PHP developers don't have to
    bother with anything like that. With PHP, you just throw some code in
    the middle of your html file.

    Also, PHP, and PHP frameworks, are supported everywhere. If you going
    to use a PHP MVC framework, like codeignitor, you would have a hard
    time finding a hoster that didn't support it - all you need is php4
    and mysql. Dollar-hosting, for $10 a year, should work just fine with
    codeignitor. With codeignitor, just copy your files to whatever host,
    and that's it, you're done.

    By contrast, the most popular Python frameworks have sky-high system
    requirements. Take a look at the requirements and/or recomendations
    for popular Python frameworks like Django, TurboGears, or CherryPy:
    Apache 2.0, mod_python (latest version), fastcgi (at least), command
    line access, PostgreSQL. And a lot of low-cost hosters don't support
    Python at all.

    Don't get me wrong: I am not saying that PHP is better than Python for
    web-development. But, I sometimes think that Python could learn a few
    things from PHP.

    All JMHO, of course.
     
    walterbyrd, Jul 25, 2007
    #3
  4. Bruno Desthuilliers

    Steve Holden Guest

    walterbyrd wrote:
    > "Once you start down the Dark path, forever will it dominate your
    > desiny. Consume you, it will."
    > - Yoda
    >
    > I'm fairly new to web-development, and I'm trying out different
    > technologies. Some people wonder why PHP is so popular, when the
    > language is flawed in so many ways. To me, it's obvious: it's because
    > it's much easier to get started with PHP, and once somebody gets
    > started with a particular language, that person is likely to stay with
    > that language.
    >
    > Before you can even get started with Python web-development, you have
    > to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
    > FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
    > difficult part of getting django to work. PHP developers don't have to
    > bother with anything like that. With PHP, you just throw some code in
    > the middle of your html file.
    >
    > Also, PHP, and PHP frameworks, are supported everywhere. If you going
    > to use a PHP MVC framework, like codeignitor, you would have a hard
    > time finding a hoster that didn't support it - all you need is php4
    > and mysql. Dollar-hosting, for $10 a year, should work just fine with
    > codeignitor. With codeignitor, just copy your files to whatever host,
    > and that's it, you're done.
    >
    > By contrast, the most popular Python frameworks have sky-high system
    > requirements. Take a look at the requirements and/or recomendations
    > for popular Python frameworks like Django, TurboGears, or CherryPy:
    > Apache 2.0, mod_python (latest version), fastcgi (at least), command
    > line access, PostgreSQL. And a lot of low-cost hosters don't support
    > Python at all.
    >
    > Don't get me wrong: I am not saying that PHP is better than Python for
    > web-development. But, I sometimes think that Python could learn a few
    > things from PHP.
    >
    > All JMHO, of course.
    >

    Indeed. The reason that PHP is so popular with so many people is that
    the core language meets most of the simpler requirements for web sites.

    Most people putting together a site are perfectly happy with something
    along the lines of PHPNuke.

    When someone starts to push the limits of PHP they either continue to
    push until they get where they want to be (producing an ugly or
    ill-maintained bunch of code along the way) or they choose a more
    appropriate tool.

    The latter behavior is typical of programmers. The former is typical of
    typical users. There are many people producing web sites who I wouldn't
    let within yards of any of my code. but it's some kind of tribute to PHP
    that it manages to satisfy so many of them. This doesn't mean that
    grafting PHP features into Python mindlessly will improve the language.

    The Python approach is a scalpel, which can easily cut your fingers off.
    The PHP approach is a shovel, which will do for many everyday tasks.

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC/Ltd http://www.holdenweb.com
    Skype: holdenweb http://del.icio.us/steve.holden
    --------------- Asciimercial ------------------
    Get on the web: Blog, lens and tag the Internet
    Many services currently offer free registration
    ----------- Thank You for Reading -------------
     
    Steve Holden, Jul 25, 2007
    #4
  5. > Before you can even get started with Python web-development, you have
    > to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
    > FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
    > difficult part of getting django to work. PHP developers don't have to
    > bother with anything like that. With PHP, you just throw some code in
    > the middle of your html file.


    Which is simply because they are preconfigured. If you have ever tried
    to recompile a PHP installation because it misses e.g. oracle support.

    > Also, PHP, and PHP frameworks, are supported everywhere. If you going
    > to use a PHP MVC framework, like codeignitor, you would have a hard
    > time finding a hoster that didn't support it - all you need is php4
    > and mysql. Dollar-hosting, for $10 a year, should work just fine with
    > codeignitor. With codeignitor, just copy your files to whatever host,
    > and that's it, you're done.
    >
    > By contrast, the most popular Python frameworks have sky-high system
    > requirements. Take a look at the requirements and/or recomendations
    > for popular Python frameworks like Django, TurboGears, or CherryPy:
    > Apache 2.0, mod_python (latest version), fastcgi (at least), command
    > line access, PostgreSQL. And a lot of low-cost hosters don't support
    > Python at all.
    >
    > Don't get me wrong: I am not saying that PHP is better than Python for
    > web-development. But, I sometimes think that Python could learn a few
    > things from PHP.


    I don't see that amongst the above is anything that python could learn.
    Using turbogears, a simple

    tg-admin quickstart

    followed by a

    ../start-<projectname>.py

    is all you need. The templating system is simple, allows for embedded
    python (to some extend, and a healthy one), database-support &
    model-stuff is easy.

    The cheap hosting and preconfigured apache setups are things that only
    the market can solve.

    Diez
     
    Diez B. Roggisch, Jul 25, 2007
    #5
  6. On Wed, 2007-07-25 at 10:42 -0700, walterbyrd wrote:
    > "Once you start down the Dark path, forever will it dominate your
    > desiny. Consume you, it will."
    > - Yoda
    >
    > I'm fairly new to web-development, and I'm trying out different
    > technologies. Some people wonder why PHP is so popular, when the
    > language is flawed in so many ways. To me, it's obvious: it's because
    > it's much easier to get started with PHP, and once somebody gets
    > started with a particular language, that person is likely to stay with
    > that language.


    That's a major reason, yes.

    > Before you can even get started with Python web-development, you have
    > to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
    > FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
    > difficult part of getting django to work. PHP developers don't have to
    > bother with anything like that. With PHP, you just throw some code in
    > the middle of your html file.


    I agree that there is a confusing number of choices, but you don't have
    to understand them all to get started. You just need a pointer in the
    right direction.

    If you like PHP's way of plopping code into your HTML, take a look at
    mod_python.psp. If you want to keep your logic and your presentation
    separate, go with CherryPy and basically any template language you like.

    > Also, PHP, and PHP frameworks, are supported everywhere. If you going
    > to use a PHP MVC framework, like codeignitor, you would have a hard
    > time finding a hoster that didn't support it - all you need is php4
    > and mysql. Dollar-hosting, for $10 a year, should work just fine with
    > codeignitor. With codeignitor, just copy your files to whatever host,
    > and that's it, you're done.
    >
    > By contrast, the most popular Python frameworks have sky-high system
    > requirements. Take a look at the requirements and/or recomendations
    > for popular Python frameworks like Django, TurboGears, or CherryPy:
    > Apache 2.0, mod_python (latest version), fastcgi (at least), command
    > line access, PostgreSQL. And a lot of low-cost hosters don't support
    > Python at all.


    The comparison is not fair on many levels. PHP is not a framework like
    Django or TG. You get a lot more stuff with Django or TG, so of course
    the requirements are higher.

    Seriously, take a closer look at CherryPy. With CherryPy, you don't even
    need Apache since it provides its own web server.

    The hosting problem is a vicious cycle. PHP hosting is easier to find
    because PHP is more popular, and PHP is more popular (partly) because
    hosting is easier to find.

    > Don't get me wrong: I am not saying that PHP is better than Python for
    > web-development. But, I sometimes think that Python could learn a few
    > things from PHP.


    What exactly could Python learn from PHP? PHP is a one-trick pony. It
    was designed for web applications. People claim they write desktop
    applications in PHP, but I don't believe them.

    Python is more powerful and offers a lot more choices. In order for
    Python to become more like PHP, somebody would have to make One True Way
    of developing web applications in Python, and that's never going to
    happen.

    Just my two cents,

    --
    Carsten Haese
    http://informixdb.sourceforge.net
     
    Carsten Haese, Jul 25, 2007
    #6
  7. Bruno Desthuilliers

    Brian Jones Guest

    Steve Holden wrote:
    > walterbyrd wrote:
    >
    >> "Once you start down the Dark path, forever will it dominate your
    >> desiny. Consume you, it will."
    >> - Yoda
    >>
    >> I'm fairly new to web-development, and I'm trying out different
    >> technologies. Some people wonder why PHP is so popular, when the
    >> language is flawed in so many ways. To me, it's obvious: it's because
    >> it's much easier to get started with PHP, and once somebody gets
    >> started with a particular language, that person is likely to stay with
    >> that language.
    >>
    >> Before you can even get started with Python web-development, you have
    >> to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
    >> FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
    >> difficult part of getting django to work. PHP developers don't have to
    >> bother with anything like that. With PHP, you just throw some code in
    >> the middle of your html file.
    >>

    I'm primarily a sysadmin, and I provide web hosting-like services to a
    community of developers who all want to do their own thing. An obvious,
    clean way to do this has, so far, eluded me. Of course I could shove a
    framework down the throats of my users, but if given the choice between
    picking up a language, or picking up a language, and an accompanying
    framework, which may or may not meet their needs, I think they'd pick
    the former. In fact, in 6 years, we've never had anyone say "boy I wish
    our web servers supported python". They've all been happily using PHP.

    I'm in a relatively small shop. But think about an ISP. If you need to
    support thousands of users who all have their own agendas, how exactly
    do you support that with Python? This is not a rhetorical question - I'd
    really like to know :)

    In short, I don't think it's the language, but deploying it in a web
    context that makes it less popular. If it were simpler, more ISPs might
    do it, more users would find what they need with Python instead of PHP,
    and it would become a more popular web language, IMHO.

    > The latter behavior is typical of programmers. The former is typical of
    > typical users. There are many people producing web sites who I wouldn't
    > let within yards of any of my code. but it's some kind of tribute to PHP
    > that it manages to satisfy so many of them. This doesn't mean that
    > grafting PHP features into Python mindlessly will improve the language.
    >

    I don't think anyone is saying the *language* itself needs improving. I
    think there needs to be a cleaner, simpler, more practical way to deploy
    Python as a generic web language instead of being forced to deploy it in
    the context of some other framework. No ISP wants to impose the implied
    limitations on their users, and the users would prefer not to have to
    learn a framework.

    Also, I just want to point out that in my discussions with other people
    who consider themselves primarily Python coders, there are plenty of
    them who still turn to PHP for web development. I got into Python for
    systems programming (sysadmin tasks and network programming). If I need
    to do web-based work, I'm likely to still use PHP because I have no idea
    how to deploy/maintain/support Python on the systems end of the
    equation. I'd love to be cured of that notion.

    brian.
    > The Python approach is a scalpel, which can easily cut your fingers off.
    > The PHP approach is a shovel, which will do for many everyday tasks.
    >
    > regards
    > Steve
    >


    --
    Brian K. Jones
    Python Magazine http://www.pythonmagazine.com
    My Blog http://m0j0.wordpress.com
    jonesy at pythonmagazine dot com
     
    Brian Jones, Jul 25, 2007
    #7
  8. Bruno Desthuilliers

    Jeff McNeil Guest

    Unfortunately, I also find that PHP programmers are usually more
    plentiful than their Python counterparts. When thinking of staffing
    an organization, it's common to target a skill set that's cheaper to
    employ and easier to replace down the road if need be.

    Also, larger hosting shops are hesitant to run things such as TG and
    Rails that require an additional server process. The name of the game
    is density. Sure, it may be easy to manage and run a TG project, but
    it's a pain to set one up on a shared hosting server.

    Lastly, I personally think it has something to do with the fact that
    so many of the popular, free, web applications are PHP based. It's
    easy for the average Web Administrator to get started with your
    standard PHP package. From there, picking up the language is the next
    logical step.

    -Jeff

    On 7/25/07, walterbyrd <> wrote:
    > "Once you start down the Dark path, forever will it dominate your
    > desiny. Consume you, it will."
    > - Yoda
    >
    > I'm fairly new to web-development, and I'm trying out different
    > technologies. Some people wonder why PHP is so popular, when the
    > language is flawed in so many ways. To me, it's obvious: it's because
    > it's much easier to get started with PHP, and once somebody gets
    > started with a particular language, that person is likely to stay with
    > that language.
    >
    > Before you can even get started with Python web-development, you have
    > to understand this entire alphabit soup of: CGI, FASTCGI, MOD_PYTHON,
    > FLUP, WSGI, PASTE, etc. For me, configuring fastcgi has been the most
    > difficult part of getting django to work. PHP developers don't have to
    > bother with anything like that. With PHP, you just throw some code in
    > the middle of your html file.
    >
    > Also, PHP, and PHP frameworks, are supported everywhere. If you going
    > to use a PHP MVC framework, like codeignitor, you would have a hard
    > time finding a hoster that didn't support it - all you need is php4
    > and mysql. Dollar-hosting, for $10 a year, should work just fine with
    > codeignitor. With codeignitor, just copy your files to whatever host,
    > and that's it, you're done.
    >
    > By contrast, the most popular Python frameworks have sky-high system
    > requirements. Take a look at the requirements and/or recomendations
    > for popular Python frameworks like Django, TurboGears, or CherryPy:
    > Apache 2.0, mod_python (latest version), fastcgi (at least), command
    > line access, PostgreSQL. And a lot of low-cost hosters don't support
    > Python at all.
    >
    > Don't get me wrong: I am not saying that PHP is better than Python for
    > web-development. But, I sometimes think that Python could learn a few
    > things from PHP.
    >
    > All JMHO, of course.
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Jeff McNeil, Jul 25, 2007
    #8
  9. walterbyrd schrieb:

    > Don't get me wrong: I am not saying that PHP is better than Python for
    > web-development. But, I sometimes think that Python could learn a few
    > things from PHP.


    Yes, indeed we can learn that popularity is not superiority. ;-)

    Gregor
     
    Gregor Horvath, Jul 25, 2007
    #9
  10. Bruno Desthuilliers

    walterbyrd Guest

    On Jul 25, 12:40 pm, Carsten Haese <> wrote:

    > What exactly could Python learn from PHP?


    Remember, I'm a noob, I'm not trolling.

    When I posted "Python" I meant the Python web-developement world. In
    particular, python frameworks, like CherryPy, have requirements that
    are not realistic for most shared hosting plans.

    Maybe I'm wrong, but I often get the idea that those who develop
    python frameworks don't give a thought to the realities of shared
    hosting. They seem to think that everybody has complete control over
    the server. Things are very different in the PHP universe.

    To use codeignitor as an example, again. On the "why codeignitor"
    part of the welcome page you will find:

    ---
    CodeIgniter is right for you if...
    * You need broad compatibility with standard hosting accounts that run
    a variety of PHP versions and configurations.
    * You want a framework that requires nearly zero configuration.
    * You want a framework that does not require you to use the command
    line.
    ---

    I don't seem to see Python frameworks using those sorts of selling
    points. Posting as a noob, who is struggling to get django configured
    on dreamhost, I gotta tell 'ya: those selling points look awfully
    attractive.

    The point is: PHP framework makers are very considerate of the
    realities of shared hosting. Python framework makers don't seem to
    give it a thought. Just maybe, that's something that Python could
    learn from PHP.
     
    walterbyrd, Jul 25, 2007
    #10
  11. On Wed, Jul 25, 2007 at 12:34:08PM -0700, walterbyrd wrote:
    > When I posted "Python" I meant the Python web-developement world. In
    > particular, python frameworks, like CherryPy, have requirements that
    > are not realistic for most shared hosting plans.


    It's true that the requirements are higher than what the old-school
    CGI/PHP web hosters offer. But with todays virtual root servers it's
    really inexpensive to run such a server. And using frameworks allows you
    to control all aspects of the web serving like URL dispatching, error
    handling and is probably even faster than PHP because necessary
    resources (like database connections) are initalized upon startup of the
    web application. PHP and CGIs do this everytime they get called.

    > Maybe I'm wrong, but I often get the idea that those who develop
    > python frameworks don't give a thought to the realities of shared
    > hosting. They seem to think that everybody has complete control over
    > the server. Things are very different in the PHP universe.


    Without wanting to sound arrogant: it's my belief that web hosters just
    offering htdocs/PHP will probably just be useful for the noob-customers
    who have no idea of operating systems but just want their blinking
    personal homepage online.

    There are good PHP applications and I wouldn't want to give up
    phpmyadmin or squirrelmail. But with today's demand for fully
    controllable interactive (you will never hear me propagate that bullshit
    buzzword "Web x.0") web sites a framework seems to be a viable way.
    For me PHP has a bitter taste of "easy enough for every noob to use it"
    which makes it the language the most insecure applications are written
    in.

    > The point is: PHP framework makers are very considerate of the
    > realities of shared hosting. Python framework makers don't seem to
    > give it a thought. Just maybe, that's something that Python could
    > learn from PHP.


    Perhaps. But the hosting market changes. And I believe that PHP suits
    the simpler applications better. I would point a beginner in web
    programming more likely to PHP than torture them with frameworks. It's
    just too heavy. OTOH full-featured frameworks are way more complicated
    and have eviler requirements but there are hardly any limitation on the
    kinds of sites you can power with them.

    EO2¢

    Cheers
    Christoph
     
    Christoph Haas, Jul 25, 2007
    #11
  12. Bruno Desthuilliers

    Paul McNett Guest

    Steve Holden wrote:
    > When someone starts to push the limits of PHP they either continue to
    > push until they get where they want to be (producing an ugly or
    > ill-maintained bunch of code along the way) or they choose a more
    > appropriate tool.
    >
    > The latter behavior is typical of programmers. The former is typical of
    > typical users. There are many people producing web sites who I wouldn't
    > let within yards of any of my code. but it's some kind of tribute to PHP
    > that it manages to satisfy so many of them. This doesn't mean that
    > grafting PHP features into Python mindlessly will improve the language.
    >
    > The Python approach is a scalpel, which can easily cut your fingers off.
    > The PHP approach is a shovel, which will do for many everyday tasks.


    Exactly right on. I actually use PHP quite a bit. For websites that
    would otherwise be static html pages other than the fact that I want to
    reuse elements (header, footer, etc.), I choose PHP in a heartbeat,
    because it's easy, and I'm lazy. Ditto if it is a simple db-driven site.

    Start adding business rules and complex program flow and I run away from
    PHP as fast as I can. I wouldn't want to actually code anything in it,
    after all. ;)

    I've seen comments that mod_python is hard to use, but I just haven't
    found that to be the case. For me, mod_python is the next step up when
    PHP no longer suits my needs. Granted, I'm spoiled because I run my own
    server and don't rely on some hosting provider to tell me what I can and
    cannot do. :)

    --
    pkm ~ http://paulmcnett.com
     
    Paul McNett, Jul 25, 2007
    #12
  13. Bruno Desthuilliers

    Jeff Guest

    I'm an ex-PHP programmer (well, I still have to use some PHP at work,
    but I don't tell anyone that at parties) who now uses Python or Lisp
    wherever possible for web development. I can tell you exactly why PHP
    is so popular: it acts as an extension of HTML and is syntactically
    similar to Perl.

    PHP mixes with HTML and removes the separation of model and view. It
    has its roots in strictly procedural code (and its OO colors were
    obviously painted on later), which is simple for non-programmers or
    beginning programmers to understand. When considered from the
    standpoint of a template language, it's a wonderful language. When
    considered as a real programming environment, its limitations show.

    PHP began as a series of Perl scripts. If you have ever looked at a
    huge PHP project, it looks just as unreadable as a huge Perl project.
    But there is a large number of programmers who began writing Perl-
    based CGI for the web, and PHP was a very natural next step for them.
    This is also a big reason why Ruby is popular among the same crowd
    (...I say as I duck the inevitable flame war I've just started). Ruby
    takes a lot of concepts from Perl and tries to make them work in an OO
    framework (the ~ operator and the built in regex type, for instance).

    I started with PHP for both of those reasons. Perl was becoming too
    much of a chore and PHP offered a solution without learning a new
    templating language: a way to embed perl code in the page itself.

    Of course, now I am in recovery and am proceeding well with my 12
    steps, thanks for asking.
     
    Jeff, Jul 25, 2007
    #13
  14. On Wed, 2007-07-25 at 12:34 -0700, walterbyrd wrote:
    > On Jul 25, 12:40 pm, Carsten Haese <> wrote:
    >
    > > What exactly could Python learn from PHP?

    >
    > Remember, I'm a noob, I'm not trolling.


    I know.

    > When I posted "Python" I meant the Python web-developement world. In
    > particular, python frameworks, like CherryPy, have requirements that
    > are not realistic for most shared hosting plans.


    CherryPy is not a framework. Also, CherryPy's requirements are very
    minimal. You either need a "vanilla" Apache/mod_python setup (which is
    no harder to set up than a vanilla Apache/PHP setup), or just Python
    itself if you use the webserver that is in CherryPy.

    > Maybe I'm wrong, but I often get the idea that those who develop
    > python frameworks don't give a thought to the realities of shared
    > hosting. They seem to think that everybody has complete control over
    > the server. Things are very different in the PHP universe.


    Again, CherryPy is not a web programming framework. It is a web server
    that "publishes" object methods.

    Also, things are only easy in the PHP world if you only use the modules
    that the hosting provider pre-installed. I doubt you'll easily find a
    PHP hosting provider that will allow connections to Informix or Oracle
    databases.

    > To use codeignitor as an example, again. On the "why codeignitor"
    > part of the welcome page you will find:
    >
    > ---
    > CodeIgniter is right for you if...
    > * You need broad compatibility with standard hosting accounts that run
    > a variety of PHP versions and configurations.
    > * You want a framework that requires nearly zero configuration.
    > * You want a framework that does not require you to use the command
    > line.
    > ---
    >
    > I don't seem to see Python frameworks using those sorts of selling
    > points. Posting as a noob, who is struggling to get django configured
    > on dreamhost, I gotta tell 'ya: those selling points look awfully
    > attractive.
    >
    > The point is: PHP framework makers are very considerate of the
    > realities of shared hosting.


    It may look like that to you, but that's not a property of the PHP
    language. I haven't seen CodeIgniter, but I imagine it's easy for you to
    set up because it's already installed by the hosting provider, which is
    due to PHP's popularity. If you could find a provider that can give you
    an out-of-the-box Django or TG set up, you'd probably find that just as
    easy. Finding a hosting provider that'll do this is the problem, of
    course, but that's not because these frameworks are designed to be hard
    to install. It's just that most providers don't pre-install these
    frameworks because there isn't enough demand.

    > Python framework makers don't seem to
    > give it a thought.


    Python framework makers have no influence over what web hosting
    providers do.

    > Just maybe, that's something that Python could
    > learn from PHP.


    What is "that", and what can Python developers do to learn "that"?

    --
    Carsten Haese
    http://informixdb.sourceforge.net
     
    Carsten Haese, Jul 25, 2007
    #14
  15. Bruno Desthuilliers

    walterbyrd Guest

    On Jul 25, 2:10 pm, Jeff <> wrote:

    > I can tell you exactly why PHP
    > is so popular: it acts as an extension of HTML and is syntactically
    > similar to Perl.
    >


    Although, that can lead to problems, if you're not careful:

    Perl:
    my $x = 5 + 9000 || 1; # $x is 9005

    PHP:
    $x = 5 + 9000 || 1; # $x is 6...
     
    walterbyrd, Jul 25, 2007
    #15
  16. Bruno Desthuilliers

    walterbyrd Guest

    On Jul 25, 2:12 pm, Carsten Haese <> wrote:

    > Also, CherryPy's requirements are very
    > minimal.


    In terms of memory and CPU, maybe. But I think that *requires* apache
    2.x and a very recent version of mod_python. By web-hosting
    standards, those are very steep requirements.
     
    walterbyrd, Jul 25, 2007
    #16
  17. On Wed, 2007-07-25 at 13:55 -0700, walterbyrd wrote:
    > On Jul 25, 2:12 pm, Carsten Haese <> wrote:
    >
    > > Also, CherryPy's requirements are very
    > > minimal.

    >
    > In terms of memory and CPU, maybe. But I think that *requires* apache
    > 2.x and a very recent version of mod_python. By web-hosting
    > standards, those are very steep requirements.


    Apache 2 came out 5 years ago. I wouldn't trust a web hosting provider
    who can't be bothered to install software that's been out for 5 years to
    stay up to date on security patches. You get what you pay for.

    Also, CherryPy does not *require* Apache. It supplies its own web
    server. Getting that server to run on a shared host may be a problem,
    but it is incorrect to state that CherryPy *requires* Apache 2.

    --
    Carsten Haese
    http://informixdb.sourceforge.net
     
    Carsten Haese, Jul 25, 2007
    #17
  18. Bruno Desthuilliers

    Daniel Guest

    On Wed, 25 Jul 2007 20:42:54 +0300, walterbyrd <>
    wrote:

    > I'm fairly new to web-development, and I'm trying out different
    > technologies. Some people wonder why PHP is so popular, when the
    > language is flawed in so many ways. To me, it's obvious: it's because
    > it's much easier to get started with PHP, and once somebody gets
    > started with a particular language, that person is likely to stay with
    > that language.


    I think Python is the computer scientist based language, whereas PHP is
    for weekend hobbyists. Not to say you can't produce serious code with PHP
    (or quick and dirty code with Python).

    Having used both, I can tell you that Python will take 10 times the
    initial effort to produce the same functionality as a PHP implementation -
    since Python programmers will not opt for quick hacks and workarounds like
    PHP coders will. The trade off however is that Python code is much more
    readable and 100 times more maintainable in the long run, which I consider
    more important.

    However this is the problem: Web Development is not about being perfect,
    it's about getting your application to production as quick as possible,
    worrying about bugs and added functionality later on. No good putting your
    idea on the web 6 months after your competitor has taken all the market
    share. PHP lets you do this very quickly, Python does not. I find myself
    trying to 'finish' the Python app whereas in PHP I would have already gone
    live.

    Today I've found the best approach for me is a hybrid solution. Since
    database models are quite definitive - it doesn't matter if I use PHP or
    Python, the underlying datastructure for my app won't change. Therefore,
    using a library of custom helpers and framework-like tools for PHP, I can
    create a working site in less than a couple days in PHP. This is made live.

    Then I have the time to rewrite the app in Python, which will take me a
    couple weeks, but due to the much better language properties of Python,
    will mean that I can also maintain it a year after writing it.
     
    Daniel, Jul 25, 2007
    #18
  19. Bruno Desthuilliers

    Steve Holden Guest

    Carsten Haese wrote:
    > On Wed, 2007-07-25 at 10:42 -0700, walterbyrd wrote:
    >> "Once you start down the Dark path, forever will it dominate your
    >> desiny. Consume you, it will."
    >> - Yoda
    >>
    >> I'm fairly new to web-development, and I'm trying out different
    >> technologies. Some people wonder why PHP is so popular, when the
    >> language is flawed in so many ways. To me, it's obvious: it's because
    >> it's much easier to get started with PHP, and once somebody gets
    >> started with a particular language, that person is likely to stay with
    >> that language.

    >
    > That's a major reason, yes.

    [...]
    > What exactly could Python learn from PHP? PHP is a one-trick pony. It
    > was designed for web applications. People claim they write desktop
    > applications in PHP, but I don't believe them.
    >
    > Python is more powerful and offers a lot more choices. In order for
    > Python to become more like PHP, somebody would have to make One True Way
    > of developing web applications in Python, and that's never going to
    > happen.
    >
    > Just my two cents,
    >

    I had a client who produced AJAX-based electronic cash registers. For
    the second generation of their technology they decided to use some
    bastardized version of PHP with GUI capabilities bolted on. At that
    point we parted company. I literally couldn't help them.

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC/Ltd http://www.holdenweb.com
    Skype: holdenweb http://del.icio.us/steve.holden
    --------------- Asciimercial ------------------
    Get on the web: Blog, lens and tag the Internet
    Many services currently offer free registration
    ----------- Thank You for Reading -------------
     
    Steve Holden, Jul 25, 2007
    #19
  20. Bruno Desthuilliers

    Steve Holden Guest

    Jeff McNeil wrote:
    > Unfortunately, I also find that PHP programmers are usually more
    > plentiful than their Python counterparts. When thinking of staffing
    > an organization, it's common to target a skill set that's cheaper to
    > employ and easier to replace down the road if need be.
    >

    Right, that's why hospitals are replacing their surgeons with butchers.
    There are so many more of them available. It's only cutting meat, after all.

    > Also, larger hosting shops are hesitant to run things such as TG and
    > Rails that require an additional server process. The name of the game
    > is density. Sure, it may be easy to manage and run a TG project, but
    > it's a pain to set one up on a shared hosting server.
    >

    Virtualization will solve that problem.

    > Lastly, I personally think it has something to do with the fact that
    > so many of the popular, free, web applications are PHP based. It's
    > easy for the average Web Administrator to get started with your
    > standard PHP package. From there, picking up the language is the next
    > logical step.
    >

    There's some justice to that.

    regards
    Steve
    --
    Steve Holden +1 571 484 6266 +1 800 494 3119
    Holden Web LLC/Ltd http://www.holdenweb.com
    Skype: holdenweb http://del.icio.us/steve.holden
    --------------- Asciimercial ------------------
    Get on the web: Blog, lens and tag the Internet
    Many services currently offer free registration
    ----------- Thank You for Reading -------------
     
    Steve Holden, Jul 25, 2007
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    352
  2. Karlo Lozovina
    Replies:
    1
    Views:
    317
    Jonathan Ellis
    Apr 16, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,073
    Smokey Grindel
    Dec 2, 2006
  4. Rajive Narain
    Replies:
    0
    Views:
    1,988
    Rajive Narain
    Sep 18, 2009
  5. neha shena
    Replies:
    1
    Views:
    269
    Dennis Lee Bieber
    Oct 29, 2010
Loading...

Share This Page