How PHP became such a huge success
We talk to PHP creator Rasmus Lerdorf
LXF: Which languages particularly inspired you early on in the development of PHP?
RL: C and Perl. Those were the two languages I was using back then. Because originally I wasn't trying to build a new language, I simply needed a way of using what I already knew within the confines of the web server and to solve a problem. I didn't need a lot of the stuff that was in Perl and I didn't want all the memory management hassle of C, so I needed a stripped-down version of C, that wasn't quite Perl, that I could easily embed and was targeted at the problem.
Later on, C++ and Java were languages we looked at to figure out what we needed to do in our object orientation code. But that was other people. I've never been a huge fan of OO – I use it when I think it's appropriate. When I have an object that carries data and some methods to manipulate the data, that's OK. But I've never been a fan of everything OO.
I'm OK with procedural code and the web is a top-down type of problem. It makes sense to me that you have HTML, you spit out a bunch of HTML, then you call a function to do something and then call another function. Yes, you might have a database object behind the scenes, but I hate things like an HTML object with a BR method on it. Brandnew field and anybody who did anything interesting stood out. Now there are so many people and those people are all getting new things out; it's impressive to me that they're able to get above the noise and all the other really cool things that are out there.
I guess the main thing I can say is: you need to give up control. If you want to build an open source project, you can't let your ego stand in the way. You can't rewrite everybody's patches, you can't second-guess everybody and you have to give people equal control.
LXF: Was there a moment like that for you?
RL: Definitely – in 1997, it basically came to the point where I was going to kill the project, because it was growing so fast and my mailbox was filling up with suggestions, complaints, patches, all these things. Up until then, I had been doing everything myself. Someone would make a suggestion, send me a patch and I'd rewrite the patch the way I thought it should be done.
Get daily insight, inspiration and deals in your inbox
Sign up for breaking news, reviews, opinion, top tech deals, and more.
I would disagree with people, I'd argue back and forth, and I just couldn't keep up any more. I was getting frustrated and sick of it all, [thinking]: "Why are all these people expecting me to fix their code? They're not paying me. What the hell am I doing working my ass off for these folks? I don't even know them – what the hell is going on here?"
So that was the time when I said: "This has to change. Give the guys who have been complaining over the last few years access to the code. The guy who has been complaining about the Oracle extension, he's been a pain in my ass for years, so it's yours now buddy. Any further issues or complaints about Oracle go directly to you." And that really empowered people.
When they felt that they now owned a slice of PHP, they started getting defensive. Instead of complaining to me about things – once they got ownership, and power, the whole atmosphere changed. And it got a lot more fun as well, because I didn't feel like it was just me against the world any more; now it was a real team effort.
LXF: Do you keep tabs on other languages such as Ruby?
RL: I think [Ruby on] Rails has tapered out a little bit lately. Maybe the new version that they're coming out with – the one that's actually fast (laughs) – maybe that will be interesting. But there are performance issues with the scaffolding and stuff, and they recognise that, which is why the new build will be better. But I've never been a huge fan of code generation, to be honest – it's building apps that have already been built.
The scaffolding, well, it looks good in a screencast, but for real-world use the scaffolding just wasn't interesting to me. And I think many other people have come to that same conclusion: 'OK, the scaffolding is cute, but we need something real.' Ruby as a language is great, I think it's a really clean and nice language. There just aren't that many people who know it well.
A lot of people went to Ruby on Rails because they got sucked in by the screencast and the 'hey, you can build an app in 10 seconds' factor. But when they needed to do something real, they thought, 'Oh crap, I don't know Ruby very well!'