
Some surprising quotes from Rasmus Lerdorf (php creator) - afterz
http://en.wikiquote.org/wiki/Rasmus_Lerdorf
======
nir
Rasmus Lerdorf created the most popular language for building web apps.
Websites that changed the world were built with this language, and most
newcomers seem to choose it as well. It managed to get a substantial share of
a market that companies like Microsoft or Sun put huge resources into.

On top of all that, he actually remains a pretty cool and down to earth guy,
as far as I can tell from reading his online stuff and hearing him speak a few
times, which makes the snarky comments here seem even more juvenile.

~~~
jrockway
But it's not intrinsically good; every one of PHP's advantages is offered by
other languages, without all the downsides. PHP's poor design and
implementation has probably cost the world millions of lost man-hours; loss
that could have been avoided by choosing a better-designed solution.

It's certainly an accomplishment to create popular software, but this popular
software is not necessarily something that should be used. The popularity is a
function of choices made by uneducated users.

(IE 6 is very popular, after all, but it's definitely not the best web browser
around.)

~~~
mcantelon
>PHP's poor design and implementation has probably cost the world millions of
lost man-hours; loss that could have been avoided by choosing a better-
designed solution.

Could you give some examples of this?

I'm not a huge fan of PHP, but it generally works, as folks like FaceBook have
proven.

~~~
shmichael
It greatly depends on what you compare PHP to, but to highlight a handful of
disadvantages,

* PHP is considered extremely weak performance-wise

* There is poor to no support of multithreading

* There is no eventing system

* As a web framework, it sins in mixing code & design (opposed to e.g. Django-Python or Ruby on Rails)

(If the term "framework" seems unfit, think of "web-targeted toolkits")

~~~
wvenable
> PHP is considered extremely weak performance-wise

I don't know, it seems a lot of the very high trafficked sites (Facebook,
Yahoo) run PHP. Yes benchmarks do show PHP doing poorly, but when was the last
time anyone used PHP to crunch numbers? It's apparently fast at what it needs
to be fast for.

> There is poor to no support of multithreading

That is not a flaw. PHP is a share nothing architecture; each request is
completely independent. This is a good match for the stateless nature of HTTP.
Multithreading isn't at all appropriate for PHP and I can't think of a
scenario where it would be needed.

> There is no eventing system

PHP is a programming language not a framework. I'd make more of a comment
about the various PHP frameworks but "eventing system" seems kind of vague.
Maybe you can clarify this a bit and then I'll comment.

> As a web framework, it sins in mixing code & design (opposed to e.g. Django-
> Python or Ruby on Rails)

Nobody mixes in code & design in PHP anymore -- you won't find it terribly
common among the various PHP frameworks. I do use it from time to time as a
debugging aid and my compiling template engine uses it as the compilation
target.

~~~
jrockway
_Multithreading isn't at all appropriate for PHP and I can't think of a
scenario where it would be needed._

Not blocking the entire PHP process while waiting for database results,
waiting for a file to download, waiting for memcached to respond, etc.

I would (and do) use an event loop for this sort of things, but lightweight
threads are technically a better abstraction. Web apps would use a lot less
memory (and hardware) if people were not so afraid of threads.

(This happens a lot; a bad implementation of something taints the whole
category. pthreads, Java threads, Perl ithreads, etc., are broken, so all
threading is bad. C++'s object model is bad, so all object oriented
programming is bad. It's sad.)

BTW: some good thread implementations include Haskell's and Perl's Coro.

~~~
wvenable
> Not blocking the entire PHP process while waiting for database results,
> waiting for a file to download, waiting for memcached to respond, etc.

The thing is, I need those database results -- I can't do anything else until
I have them. I received a single request from the user and I'm spitting out a
single HTML response back. That's what PHP is all about. And mulithreading as
optimization itself wouldn't improve performance because I'd be taking away
CPU from other requests that are running concurrently.

> Web apps would use a lot less memory (and hardware) if people were not so
> afraid of threads.

Fundamentally I don't disagree; there's a lot of cool work going with event-
based web servers. However, I think those designs are great for very specific
tasks like chat servers and but require too much fiddling when doing
traditional stateless web work. However, it may indeed be the future.

~~~
jrockway
_The thing is, I need those database results -- I can't do anything else until
I have them._

You could start requesting the database results for a user that is now waiting
in the tcp connect queue, cutting latency significantly.

Most people handle this with load balancing between processes, but your
blocked-for-DB-results-process is sitting idle using system resources, like
memory.

If you only have one user using your site at a time, then this isn't a
concern. But for everyone else, blocked processes are wasteful.

 _but require too much fiddling when doing traditional stateless web work_

Well, yeah, because you don't have threads. When you do, everything is handled
by libraries for you; you can think you're blocking, but actually not block
the process.

~~~
wvenable
> You could start requesting the database results for a user that is now
> waiting in the tcp connect queue, cutting latency significantly.

That's already how it works. If one process is blocked waiting for results,
another process will get it's turn. Apache is one process per HTTP connection
(when not running threaded).

> but your blocked-for-DB-results-process is sitting idle using system
> resources, like memory.

Either way it will need to use system resources. I can't throw away the
resources of the user waiting for results, I need that once the results come
in! Processes really don't take up that much memory and typically you're
reusing a small number of them over and over anyway.

> If you only have one user using your site at a time, then this isn't a
> concern.

If somebody is blocked then someone else's request gets a turn at the CPU.
Blocking a single process is completely inconsequential to multi-process web
server serving multiple users.

~~~
jrockway
_Processes really don't take up that much memory and typically you're reusing
a small number of them over and over anyway._

They take up several orders of magnitude more memory than lightweight threads.
I did some benchmarks a few months ago showing this; check searchyc if you
care. Edit: here you are: <http://news.ycombinator.com/item?id=794409>

Anyway, when you start thinking about "web applications" instead of "web
pages", lightweight threads make a lot more sense. And, you'll find that
treating a web application like it's just a bunch of web pages leads to many
problems down the road. (Performance is the least of your worries.)

Finally, "I definitely don't need to know about this abstraction because my
favorite language doesn't have it" is dangerous thinking.

~~~
wvenable
> They take up several orders of magnitude more memory than lightweight
> threads.

Premature optimization; when a 1st grader can count to the number of processes
you need for large scale web application optimizing it any more is a waste of
time and effort.

> You'll find that treating a web application like it's just a bunch of web
> pages leads to many problems down the road.

Really? I find it refreshingly helpful. Instead of your large application
being a large application, it actually just a series of very small
applications. If a page crashes, it's pretty much no harm at all. If your
whole application crashes, you're screwed. You want to add some functionality,
just add it on.

> Finally, "I definitely don't need to know about this abstraction because my
> favorite language doesn't have it" is dangerous thinking.

"Oooh shiny" is also dangerous thinking. Is it really better to waste your
time using up as many threads as possible or actually solving real problems
for a few hundred processes?

Sidebar: Why is always you, Jonathan Rockway? Just how many posts do you make
on Hacker news in a day? :)

------
thejo
He's always been pretty open about his "just get the job done" approach.
That's exactly what PHP is too. Not beautiful, well designed etc., but gets
the job done in most cases.

This is a mail he showed at a talk - <http://lerdorf.com/fanmail.txt>

I'm sure he enjoys it when people get worked up about PHP :)

~~~
randallsquared
That email is confusing. "From: damien taylor" in 2003 yet signed "Walter
Bagdasarian", which unusual-seeming name belongs to a guy who was convicted in
2009 of threatening Obama. Odd.

~~~
akamaka
It fits, he got arrested for posting an idiot comment about Obama on the Yahoo
message boards.

~~~
jacquesm
Used to be you had to do something before you got charged.

Threatening seems so much like thoughtcrime.

~~~
ubernostrum
Making threats has been a "something" that's considered a crime for... well, a
long time. Typically the law requires that the threat be at least somewhat
believable in order to be successfully prosecuted, but there are certain types
of threats which are criminal regardless of ability to be carried out (e.g.,
threatening to plant a bomb in a public square is a crime, even if you have no
way of building or planting the bomb).

~~~
jacquesm
A message on a yahoo board seems to be a bit of a stretch though.

~~~
ubernostrum
Threats made against the President are handled rather specially, by people who
aren't inclined to view online message boards as trivial.

------
kgrin
To be fair, some ("I still am really bad at writing parsers.") seem to be more
signs of humility than confessions of incompetence.

~~~
jrockway
Read PHP's parser.

~~~
sorbits
The parser in PHP 3 and up was written by Zeev Suraski and Andi Gutmans:
<http://en.wikipedia.org/wiki/PHP>

~~~
sjf
The original parser was written by Lerdorf (source: your wikipedia link).

But I don't think any of them have anything to be proud of:
<http://www.steike.com/code/php-must-die/>

------
zaphar
Those quotes aren't surprising. Someone with the attitude shown in those
quotes would create a language exactly like PHP. And that language would be
hated by most of the people who actually enjoy coding.

------
nostrademons
Most of them aren't that surprising if you've used PHP. ;-)

------
Asa-Nisse
This makes me love PHP more. If that was possible.

He just gets it. If you want to spend your days drawing UML, writing
documentation and unit tests. That is dandy, but you're in PHPLand now. This
is our land, and we dont care about no freakin' memory leaks.

~~~
tentonova2
Do you have any concept of just how much time and money hacked-together PHP
has cost?

Do you know how many aggregate human lifetimes are wasted on the simple act of
regularly upgrading PHPBB, WordPress, MediaWiki, et al?

It's mindboggling. It's sad. It's penny wise, pound foolish.

~~~
jawngee
Yet Wordpress is still the most widely used blog software ever. PHPBB and it's
ilk still run the forum game. Wikipedia has yet be unseated.

If it's cost > it's profit, why is it still used so widely?

I recently replaced a C#/.NET app with a PHP version and saved a company close
to a million a year in licensing, servers, staffing and development costs. Not
to mention it took my team a third of the time to develop as the original
application, yet performed better and had more functionality. There was a
significant gap in LoC as well.

~~~
tentonova2
_Yet Wordpress is still the most widely used blog software ever. PHPBB and
it's ilk still run the forum game. Wikipedia has yet be unseated.

If it's cost > it's profit, why is it still used so widely?_

Network effects, data lock-in, asynchronous information exchange in markets.
Just because something is rationally better doesn't mean that the market
actors are rational.

That said, companies like EA, Apple, and Amazon license Jive Forums (which is
_not cheap_ ), Confluence, et al for a reason.

 _I recently replaced a C#/.NET app with a PHP version and saved a company
close to a million a year in licensing, servers, staffing and development
costs. Not to mention it took my team a third of the time to develop as the
original application, yet performed better and had more functionality. There
was a significant gap in LoC as well._

Your anecdote is a personal anecdote, coming from the person most likely to
have a particularly jaded view of both the short and long-term costs involved.

~~~
jawngee
_We dropped PHPBB and moved to Jive Forums several years ago, as the costs of
weekly updates and surprisingly regular break-ins easily outweighed the cost
of licensing Jive's software. However, moving away from the forum required
data migration, which was difficult and time consuming._

And that's not a personal anecdote? You aren't particularly jaded? I don't
understand why I would have a jaded view of the short and long term costs
involved. You'll have to explain. I'm not a PHP developer, btw. I consult
across a wide variety of technologies and have done so for the last 15+ years.
I would have certainly been better paid for that particular gig had I stuck
with C#.

It would make sense that Apple and Amazon use Jive since all of their web
properties are largely Java based, why step outside of a core competency?

~~~
jawngee
And just to be clear, I would never recommend any PHP forum software (just ask
the exasperated folks @ Massify), mostly because I think they are functionally
retarded and security is a joke. But that has little to do with PHP than it
does with the way they are written.

------
jdp
At least he's not trying to kid anyone.

------
senko
To add to the noise here: all people bashing here, please remember webdev
landscape around the time PHP got started (or around the time it got to
version 3, which looked somewhat a real language).

I started using PHP as a switch over from Perl (which had some powerul but
cumbersome templating engines, and boiled down to much more boilerplate than
PHP for the same task) or C-based CGI ( _that_ was not fun).

So, I see PHP as an enabler to webdev to the masses. It was really hard to do
"dynamic web pages", as these were called back in the days, in anything else,
and it was a breeze in PHP. I believe this is why many people started doing
it, which in turn resulted in developing better frameworks for better
languages (like Rails, Django, etc.).

Comparison with IE6 has been drawn. IE6 was the best browser in its day. The
trouble is, it stayed dominant for far too long. The same could be said for
PHP. If it was massively replaced by other alternatives by, say, the time PHP5
came out (which IMHO looks as the first PHP version that considered itself as
a serious language; php<3 were gross hacks, php3 was nice, php4 was service
pack to php3), then many woes now attributed to it would never have existed.

I personally use Django nowadays for any new projects I do, having done stuff
in PHP before. I have a hate/hate relationship with PHP, I consider it a very
bad language as languages go, but it's still invaluable for quick hacks, in
which boilerplate for other system takes more to generate than writing the 10
or so lines of PHP.

------
10ren
If we write for our peers, and you are a highly qualified academic, then your
market is small. But if you just want to get the job done, you have many
peers, and your market is enormous. And, at times, every one of us just wants
to get the job done; and at times, each of us is so distracted or tired that
our effective intelligence drops.

For _market_ success, the ideal place to be is _just_ smart enough to be able
to understand the ivory tower issues that the solution needs; but dumb enough
to relate to the everyman and agree with him ( _"Or walk with kings - nor lose
the common touch"_ ). Or perhaps it's idealistic vs. pragmatic - regardless,
you need both.

------
rams
He also reportedly said,"Humans can't write thread-safe code. It's simply
beyond us". (Can't find the source). I have heard him say at a conference
that, PHP is for week-end warriors.

~~~
docgnome
I've heard Joel Spolsky say that.
<https://stackoverflow.fogbugz.com/default.asp?W29083>

------
david927
I don't like PHP as a language and so it's not surprising that he admits to a
shoddy, poor effort.

But I, too, dislike programming; languages are kludgey. (Ok, LISP and its
derivatives aren't, but that's not solving the problem as much as reducing the
problem set to one that can be solved.)

I like building things, and if to do that, I have to program, so be it. But I
constantly feel like I'm building a house with Scotch tape.

------
10ren
recent reddit submission & discussion on Rasmus:
[http://www.reddit.com/r/programming/comments/anmgx/i_hope_no...](http://www.reddit.com/r/programming/comments/anmgx/i_hope_no_one_ever_does_this_to_you_because_it/)

and the HN thread: <http://news.ycombinator.com/item?id=1043400>

------
omouse
Let PHP be a lesson in what happens when you don't think before you code.

------
jdale27
Not surprising at all.

------
ahoyhere
When you're in the audience and he's keynoting, it doesn't feel like "Hee hee,
lazy programmers are good programmers." It feels like "This is stupid and by
extension, so are you, and why am I even talking to you about this?"

I don't think he's a happy person, either.

