Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Why PHP is so much more popular for web-development

Reply
Thread Tools

Why PHP is so much more popular for web-development

 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      07-22-2007
walterbyrd a écrit :
> On Jul 25, 12:40 pm, Carsten Haese <(E-Mail Removed)> 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.


 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      07-22-2007
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.
 
Reply With Quote
 
 
 
 
walterbyrd
Guest
Posts: n/a
 
      07-25-2007
"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.

 
Reply With Quote
 
Steve Holden
Guest
Posts: n/a
 
      07-25-2007
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 -------------

 
Reply With Quote
 
Diez B. Roggisch
Guest
Posts: n/a
 
      07-25-2007
> 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
 
Reply With Quote
 
Carsten Haese
Guest
Posts: n/a
 
      07-25-2007
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


 
Reply With Quote
 
Brian Jones
Guest
Posts: n/a
 
      07-25-2007


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

 
Reply With Quote
 
Jeff McNeil
Guest
Posts: n/a
 
      07-25-2007
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 <(E-Mail Removed)> 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
>

 
Reply With Quote
 
Gregor Horvath
Guest
Posts: n/a
 
      07-25-2007
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
 
Reply With Quote
 
walterbyrd
Guest
Posts: n/a
 
      07-25-2007
On Jul 25, 12:40 pm, Carsten Haese <(E-Mail Removed)> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Training Institute In Delhi, Live Projects on PHP. Short TermPHP Courses, PHP Scripts, PHP Training with Live Projects. Rajive Narain Java 0 09-18-2009 10:47 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
One measurement by which Python is more popular than Ruby, Java, Perl, PHP and .NET UrsusMaximus@gmail.com Python 0 09-26-2005 02:06 AM
Are Dvd-R more popular then the +? Why? lbbs DVD Video 29 01-11-2004 02:14 PM
Are Dvd-R more popular then the +? Why? lbbs Computer Support 9 01-08-2004 12:24 AM



Advertisments