

How PHP became such a huge success - Talk with Rasmus Lerdorf - edw519
http://www.techradar.com/news/computing/pc/how-php-became-such-a-huge-success-633591

======
mdasen
PHP became such a huge success for a few reasons. It's easy to deploy. You
just have .php files that execute code in <? ?> tags. It has a bunch of
framework-type things built in such as all the database connector functions,
session handling, and it returns HTTP responses easily.

What really bothers me about this article is that the author goes after Rails
without knowing anything. He says that Rails is slow. That simply isn't true
when compared to PHP frameworks. Rails is many times faster than CakePHP. And
Rails has a ton more features. It's all well and good to just spout off that
Rails is slow, but actual investigation proves that in the real world it isn't
true.

See: <http://video.merbcamp.com/public/katz3.mp4>
<http://avnetlabs.com/php/php-framework-comparison-benchmarks>

Lerdorf doesn't even seem to know that scaffolding really isn't Rails. He just
comes off as someone who doesn't actually know or get the technological
landscape.

~~~
garnet7
> It's easy to deploy.

Yup. This is the reason PHP is trouncing Python. Python should be where PHP
is, right? But it isn't. If you ask the Python folks for easy deployment,
they'll go into a lecture about how it's ugly, or a hack, or not general
enough. And then they'll start telling you about how you should be using WSGI.

You: "I like vanilla."

Python: "What? Vanilla? There are better flavors than that. C'mon. Let's get
you some nice strawberry."

You: "But I don't like strawberry.

Python: "Well, you should! It's a great flavor! How many scoops would you
like?"

You: "[Sigh]. 2. Sugar cone, please."

Python: "Here you go!"

You: "Hey, this is a wafer cone. And it's only one scoop. And it's sherbet!"

Also, learning to make a scripting language spit out some html is easy.
Learning how to get various apache modules built, configured, and installed --
or convincing an inexpensive ISP to do so -- is a whole nother ball of wax.

AFAICT, PHP did deployment right, and is still making "better" languages look
like they can't get their act together. I should be able to drop a .py file
into my docroot and a _persistent_ apache-managed python should execute it
(when it's requested) and spit the results back to my browser. It's
astonishing that we don't have that.

You: "I like vanilla."

PHP: "Here you go. Vanilla. Also take these napkins -- it's a little drippy."

~~~
gaius
Websites are a small corner of the Python world, but _all_ of the PHP world.

~~~
garnet7
Everywhere I look, when new programmers ask what language to learn first, they
are most often told to learn Python.

C is too low-level, Perl's too old and crufty, Ruby's too trendy, Scheme is
too esoteric, Haskell's too difficult, Lua doesn't have enough libraries,
Java's too verbose and corporate, ... the list of reasons not to go with other
languages is a mile long. Note: PHP is usually never even mentioned.

Then the new programmer asks what language they should use for web
programming. At this point, everyone looks at the floor, scratches the back of
their neck, clears their throat a bit, and says that, well, you should
probably use PHP because that's what everyone else is using.

So, in most corners of the programming world, many experienced programmers are
recommending Python.

You know how to get "everyone else" to use Python for web development? You
make it easy to deploy -- just like PHP.

~~~
nostrademons
I usually tell people "Use Python and Django" when they ask me what language
they should use for web programming.

I agree though, Python apps should be _much_ easier to deploy on the web. Just
because it's currently the best solution doesn't mean it can't be better.

------
rarrrrrr
We previously had a poll here of which languages have the best "innards" or
something like that.

I wonder what a similar poll on languages with the best "outards" would be
(i.e. documentation, learning curve, simplicity of initial setup, time from
total n00b to achieving your first actual goal, friendliness of the community,
etc.)

While I don't enjoy PHP as a language, it clearly excels at all of the above.
I'm not surprised that it has a large user base.

~~~
pbiggar
Friendliness of the community? I've not seen it. I've found the internals
group to be particularly unfriendly, though perhaps that's not the one you
meant.

~~~
dasil003
I imagine they would be quite defensive based on the amount of hate they must
receive.

------
davidw
Cool. I don't care much for PHP, but I worked with Rasmus briefly at
Linuxcare, and he is a cool guy.

And, when it comes down to it, PHP has made it possible for more people to do
more things with the web than before it came into existence, so you do have to
give it some credit. With the caveat that it's easier to write those kinds of
nice things when I'm not currently being forced to deal with any PHP:-)

------
snewe
Perhaps this explains the hate for PHP by "real" developers:

"It tends to be that code wins. If two groups are arguing, but one group has
an implementation and the other doesn't, well, the implementation wins. It
almost doesn't matter how braindead it is; if we should have the feature, but
we can't agree on the implementation, we'll go with whoever builds it."

------
billpg
Because cheap webhosts support it. I would never have bothered learning PHP
were it not for them.

------
pyman
Python is great for small apps or server scripts. For building large-scale
enterprise apps, it's a NO-NO. The code can become unmaintainable. I can't say
the same for Java, Ruby and PHP apps though.

------
xtho
> If two groups are arguing, but one group has an implementation and the other
> doesn't, well, the implementation wins. It almost doesn't matter how
> braindead it is

I'm the least bit surprised.

------
korch
I detest PHP, and have been lucky enough to mostly avoid working with it. But
I'm currently leading the development to convert an 80k line PHP app to Rails,
and I'm absolutely shocked at how fundamentally flawed PHP code is from the
perspective of general best practices in software and web development and also
computer science. PHP code is so bad that it deserves it's own section on
dailywtf.com.

I think PHP has been successful because it's the Visual Basic of the web. Just
like in the 90's with the programmer "holy war" between Visual Basic
"developers" versus everyone else(C++ mostly). At that time the number of
"pseudo-developers" dwarfed the number of "real" developers, and so Visual
Basic ended up being used for all kinds of stuff, in companies all over the
land, and for all kinds of software for which it was totally inappropriate.

It was termed "Virus Building" for good reason, and not just because M$
software was so exploitable. With Microsoft dominating the desktop, they were
able to embed Visual Basic everywhere. It's the oldest trick in the book: if
you can be the distribution platform, your default tool set will end up being
the most used simply because people are too incapable and lazy to tweak and
customize software themselves. To paraphrase Steve Jobs' remark about people
reading: "people don't tweak anymore".

There's been a similar demographic split on the web for the past decade. The
number of web developers who know nothing about software engineering in
general dwarfs those who know best practices, computer science and stuff like
that. Add in the sweet spot of the entire hosting industry defaulting to
Apache and the LAMP stack, PHP got to be the default tool, like Visual Basic
on Windows desktops. It's totally impossible to "win" against these kinds of
numbers--we can only wait for the platform to change, then PHP will be dead,
just like how Visual Basic is now "dead".

Perhaps the whole "cloud computing" hoopla and mass move to VPS will pull the
rug out from under PHP in the next 2 years.

~~~
NathanKP
_"I'm absolutely shocked at how fundamentally flawed PHP code is from the
perspective of general best practices in software and web development and also
computer science. PHP code is so bad that it deserves it's own section on
dailywtf.com."_

I assume that your 80k line app must have been written very poorly. Like any
other good language PHP can be misused to create horrifying spaghetti code.
That doesn't mean the language is no good.

