No.

[A real pissing contest after the jump.] The problem is that Jeremy Privett is following the PHP internals mailing list. If he bothered to look at the archives he’d know this crap is as old as time and just as publicized back then as now. There were just as many egos then as now. Heck, some of the egos are the same.
See the forest from the trees.
Do we honestly think anyone cares what people say on php internals?
Cute girl: “What do you do?” Me: “I’m a PHP Software Architect.” Cute girl: “What’s PHP? It sounds like a drug.” Me: “No, it stands for PHP Hyper… nevermind. It’s a web language.” Cute girl: blank stare Me: “It’s the thing that powers more websites than any other language.” Cute girl: blank stare Me: “Umm, it powers Yahoo!” Cute girl: “Oh!” dead silence Cute girl: “Hey, does it ‘power’ MySpace?” Me: “No, they use dotNet.” Cute girl: turns the other way and starts to talk to the other guy

It’d be very shortsighted to judge the health of PHP from the internals mailing list. (Corollary: Don’t try to pick up a girl using PHP, reality <> fantasy.)
PHP should be more like Ruby (on Rails)
“As much as I hate to say this … You guys really need to take some advice from Ruby Devs.” —Jeremy Privett on PHP internals developers
Yes, and maybe if we work really hard at promoting ourselves we can get a developer to create a site using PHP that will reach #700 on the internet that fails so often that they’ve ruined the cuteness of cats.
Oh Rasmus, why do you engage in this “virtual crap-flinging”? Can’t you lead by example like David Heinemeier Hansson? That guy is the height of maturity and an expert scalability guy.
The PHP Sky is Falling! If PHP doesn’t get it’s act together Rails will unleash their dogs of fury.
Who let the dogs out?
“First they ignore you, then they laugh at you, then they fight you, then you win.” —Mahatma Ghandi
OSCON 2005:
“Unless you’re Ruby.” —Danny O’Brien, “On Evil”
OSCON 2006 (Year of the Dog):
Out with the dog
This quote got me into a lot of trouble:
“Ruby is really good at what it does. The problem is, for what Ruby does really well, I can download WordPress. [Ruby is] really good at building those apps that have already been built before. PHP is good at finding out what the next WordPress is.” —Terry Chay, “Interview with Terry Chay”, Pro-PHP Podcast
I was born in the Year of the Pig and it’s my year now. Out with the dog!
Here is one for you:
- People like me are smart and have to run extremely large scalable internet infrastructures.
- People like me have used Rails.
- People like me don’t use Rails to build extremely large scalable internet infrastructures
To the Rails developers that’s an inconsistent triad. They’ll say I’m actually dumb and I don’t “get” Rails. To me, it’s completely consistent (They’re right about me being dumb, but that’s what makes me smart):
And I’m going to tell it like it is:

Let’s have a little reality check. Yahoo! is #1 on the internet. Heck, even Tagged does way better than than #726 (#92 today, after a series of really bad site outages). And Tagged isn’t even close to the largest website written in PHP in its space (That belongs to #18, Facebook):
I remember before Yahoo! adopted PHP, every small site that I could find that used PHP I was shouting from the mountaintops—“NASCAR uses PHP!”
Twitter may be at 700, but it’s a great product and it’s probably the largest Rails installation on the internet. Before that it was…what was it? Oh yeah!
And how about that David Heinemeier Hansson guy? What a great guy huh?
If I were David Heinemeier Hansson, I’d be fellating Alex Payne right now for proving that Rails can scale, as long as you rip out all the stuff that makes Rails attractive in the first place. (Think of it this way: How many twitter clones are there? What was the barrier to entry? How dependent was twitter on hype? If they didn’t use Rails would have the lag time for using PHP or some other language hurt? Now isn’t that something to be proud of?)
But what does this so-called master of the PR do? Oh yeah.
Remind me, what is DHH doing lecturing al3x about scalability?
WWRD? (What would Rasmus do?) I’ll tell you what he wouldn’t do. He wouldn’t say that his largest installation can’t scale because they don’t know PHP. He wouldn’t write a book bragging a company that has never broken into the top 1000 can purport to tell you about success.
He also wouldn’t engage in this mudslinging or “pissing contest.”
But that’s why I’m around.
If Zend puts your photo on a deck of cards, you’ve either arrived in the PHP world or are a terrorist.
I’m a PHP terrorist.

Go look me up in the archives. I’m not even the one doing the pissing there. But I piss on whom I please, and say what I want, and Rasmus has to just shake his head and take it. (Hence the irony in WWRD?—get it now?)
Marking my territory by pissing on the Rails
Alex Payne isn’t saying Rails is crap; I’m not saying Rails is crap. We’re not even saying Rails can’t scale or Ruby can’t do the web.
I can’t speak for Alex, but what I’m saying is look at the top 100 websites on the internet: about 40% of them are written in PHP and 0% of them are written in Rails. (Yes, I can (and am) using this statistic to grind you Ruby fuckers into the dust.) But to me, there is an alternate conclusion, since 60% of sites out there don’t use PHP:
“The web problem ain’t that hard.”
PHP may be the best web language out there. But it certainly isn’t the only one. It’s one approach, one that stresses configuration over convention, stupidity over smarts, practicality over elegance: it’s one ugly mother f—er that gets shit done.
I didn’t choose Ruby on Rails because I hate it (I don’t, it’s a very clever approach). I didn’t choose it because Convention over Configuration is untested and unproven in the marketplace. I didn’t choose it because I didn’t want to be the guy saying “I’m not going to hire you because you don’t ‘get’ it.” I’m not going to get the Ruby religion because when it comes to languages, I’m an atheist. I didn’t want to be the guinea pig when Rails hit a ranking of 5000, or 1500, or 700, or 500, or 300, or 100, or 40, or 15, or 1 (Yahoo! and PHP, undefeated).
But al3x did (at least to 700 anyway). And that’s why Ruby on Rails world should stop having their own circle jerk and honestly address the real problems: Less “Oh, we just need to implement connection pooling or Query Cache. And, by the way, didn’t DHH just put that kid al3x in his place, that totally r0x3rd.” and more “How can we give scalable sites alternatives to Active Record? And, by the way, maybe those people who build really large websites daily have something to teach us.”
You want me to stop laughing? Then stop picking on your own and start proving me wrong!
Me, fully quoted
August 2006 (Year of the dog):
There are those answers out there and in many ways, since they’re web companies, PHP is an easy way to build those answers. Because there are things like Ruby out there. And Ruby on Rails is extremely good at doing real simple things like building a recipe database—you can do that in six lines of Ruby.
But the thing is [Rails] is a framework so you eat the entire framework when you do that. PHP has no framework. You can choose to use a framework but it has no framework. So look at the problem. You don’t start with anything [and that] hurts you initially, but it really helps down the road because a lot of these answers are not simply: let’s build an e-store and somehow magically make money. The answers you have to construct are Web 2.0-style answers, they’re not simply reducible to selling dogfood on the web—they’re more complex answers than that. So you require a language that can navigate that complexity without forcing you to eat that framework that boxes you in and colors the lines for you to build that web database…
I know it sounds like I’m ragging on Rails, but I’m just trying to emphasize the strength of PHP. I like to say that complicated systems must always have simplistic behavior because they’re too complicated for people to understand. It is complex systems built on simple ideas that can have complex behavior. And PHP, while it doesn’t have the advantages of quick-start that Rails gives you, does have advantages in its flexibility, its pragmatism, its stupidity (if you will) that allow you to build those complex systems by stringing together a bunch of simple ideas.
If there is one thing I want the listeners to take home it’s that eCards or whatever, this is just one perspective of how I built one thing. But there is a general answer there—like Louis Pasteur saying, “Chance favors the prepared mind”—there is an opportunity in the listener’s institutions where PHP is a very powerful tool, very easy to understand, waiting for the listeners to use to build these amazing complex systems by stringing these simple things that PHP gives us.
…
I’m really low on my scatological count here…I’m sorry I didn’t crack enough jokes or use enough [cuss words], but I’m sure people will forgive me. They can just attend one of my talks and get their cuss quota for the year. And if not, coding these web apps themselves involves a lot of swearing—a lot of blood, sweat and swear.
…
Ruby is really good at what it does. The problem is that for what Ruby [on Rails] does really well, I can download Matt Mullenweig’s WordPress… It is really good at building those apps that have been solved before. PHP is good at finding out what the next WordPress is, what the next CMS is, or wiki is.
It is a very configurable, flexible language for answering those questions and it doesn’t strap you in and say, “PHP. The only way to do things.” It can’t do jack without Apache, without MySQL or another database like Oracle, or Java or C or accessing the command line to get shit done. Because of that, it’s never going to tell you that you have to do it “the PHP way” whatever the hell that means as opposed to do it the way you want to because you happen to have this nice tool whether it is imagemagick or whatever.
And that is where PHP is strong.





Funny that the “Getting Real” website is seemingly written in PHP. Hrm.
I would be much, much, much more likely to use Rails if it wasn’t such a masturbatory, self-congratulating, arrogant community. This is the kind of shit that I’m talking about:
http://www.robbyonrails.com/articles/2006/04/13/canada-on-rails-day-1-part-1
I have a lot of trouble using tech developed by people I find even semi-abhorrent.
Any blog post that starts with the word “beholding” better be about a near death experience or that time you did peyote with your cousin. It better not be about some goddamn tech conference you were at:
http://jroller.com/page/obie?entry=railsconf_2007_opening_keynote
Beauty and significance and the search for Truth in Coding is all very wonderful, but if you can’t take the piss and have a sense of humor and irony about this programming shit, you should hang it the fuck up. You’re not curing cancer, dude, and you’re not making it easier to cure cancer, either.
“It’s fun and feels good to think of yourself as a world changer. But every time I hear the phrase, I think about those street corners and back alleys, and I feel a little cheap.” – Chad Fowler, http://www.chadfowler.com/2007/5/19/changing-the-world
Great blog entry
I guess I should catch up on the podcast now!
Ever notice the biggest dicks on hazing rituals in schools are the ones who weren’t hazed when it was their turn (their mom died or something)? It’s like they can’t empathize and have some big insecurity going on and have to lash out or something. (Is it a coincidence that the union of Mac fanatics and Ruby developers is Mac fanatics?)
I think the attitude comes from the fact that Ruby went from “They Ignore” to “You Win.”
Case in point: “Ruby on Rails is the One True Language and DHH is its only Son and Savior.” Yeah, that sounds about right.
“PHP is the One True Language and Rasmus is its only Son and Savior.” Say that without ROTFLMAO.
Oh yeah, and to any of you who disagree, “I have just two words for you…”
(Thanks, Ed and others…)
Rails is a golden hammer, it’s opinionated software. That’s why it’s good for blogs and online shops, just as every ROR tutorial tells you. It won’t necessarily fail when you try to run a real application with rails, but all shiny ROR feauters become more or less useless at that point, as you stated.
I love twitter!
Pingback: onekay » Blog Archive » Is PHP a solid job prospect?
@Davey: Never noticed. I guess DHH is more practical than I give him credit for.
@Aaron: I quoted all the good parts.
This would have made a great bookend to this article:
(Yeah, you’d have thought it’d be my slide, but it’s actually the creator of Ruby on Rails and the two words he has for me.)
Can we stop confusing “Ruby” and “Rails”, please? They are not the same thing.
Compare Ruby and PHP all you want – but don’t pretend Rails and PHP are the same thing. Terry says:
Well, bingo. That’s because PHP is a langauge, just like Ruby. If you want to compare frameworks, feel free to pick your favourite out of symfony, Cake, CodeIgniter, Seagull, whatever, and then compare it to Rails. Right now, you’re comparing apples and oranges, and it makes relatively little sense to do so.
(Also, if we do get to an apples and apples stage, please do so accurately – I’m not sure where Maarten’s “all the features in ROR are only good for blogs or online shops” comes from… ActiveRecord is slow when you have pagerequests like Twitter does… but so would anything be! Even caching the hell out of it, they’re doing a lot of requests. A lot. The pages on Yahoo that handle that sort of traffic are custom-written, one-offs, which work around the standard conventions they have just to keep up with traffic. Don’t go around saying the “features are useless” for anything other than “blogs or online shops”, because it honestly smacks of someone who’s never a) used Rails in anger, b) done anything other than Rails tutorials and c) not even read the documentation to appreciate what features might not be scaling so well. You’re not going to get anywhere in this discussion when you can’t get facts straight).
LOL, you mean the WordPress, clone of MovableType, or I miss something? What will be next? Another clone.
@paks: Yes WordPress, the fork of b2 which was a competitor of MoveableType and the more popular open source package for blogging (though SixApart is doing better than Automattic in the blog services space right now). MoveableType is a clone of Userland Frontier which was written Delphi for all I know. Where is Ruby?
Wikimedia which powers Wikipedia is written in PHP is a clone of WikiWikiWeb which was definitely not written in PHP. One could also point out digg was written in PHP but is a clone of Slashdot which was written in Perl. Oh and there is chora which is a clone of ViewCVS written in Perl. And how many of us use Trac for issue tracking—it’s written in Python. If you use CVS, then it’s probably CVSTrac which is written in C.
Oh and then there are the libraries like SimpleXML which is a clone of simplexml from Perl. And ADODB which is a clone of ADO which is written in C++. PDO which is a clone of perl’s DBI. GD which was a library written in C that was forked and merged into PHP. Memcache which was written by a Perl guy in C, but now maintained mostly by PHP shops like SmugMug and FaceBook. And PHP itself mostly runs on Apache written in C and mostly populated by Java developers.
What was your point?
That’s right. You have none.
@tom: Who is being ambiguous here? When someone says “I installed Linux.” do they mean the kernel or the entire software stack that comes with a typical distribution?
When Thoughtworks writes “Desperately seeking Ruby talent” do you think they mean pure Ruby developers or Rails developers? When JavaOne talks about Ruby do they mean Ruby or Rails? When people compare Ruby to PHP do they mean to compare Ruby on Rails to PHP as a development platform or do they mean to compare Ruby the scripting language to PHP CLI?
How many websites out there are built using symfony or PHPCake? In fact when people push those for highly scalable websites, I apply the same arguments against them. Maybe you think my article is therefore a tirade against general web frameworks. Fine, read it that way. I’m not going to fight anyone there because my point has always been when you pick up one end, you pick up the other—programming patterns have consequences; and so do web languages.
Don’t purport to say that I’m being ambiguous when for all intents and purposes, Ruby on the web is Ruby on Rails. You’re going to have to accept that there is a defacto definition of Ruby for web development and it is Rails. (Aside: I often use the same confounding between Java and J2EE. It doesn’t apply nearly as much there, but Java developers don’t seem to call me out on that.)
Rails is successful in the Ruby world because it stresses the same cleanliness and code philosophy as Ruby itself. If that idea was truly portable to the PHP, Perl, or Python world then things like symfony or cake would be far more successful than they are. Are are you going to have the mistaken belief that Ruby somehow has a monopoly on good programming talent? Because your world certainly acts that way and I find it both humorous and littered with hubris. Would you like to compare Ruby as a web development language to PHP as a web development language? Bring it on! Because at the end of the day, the web’s top 100, top 1000, even top 10,000 statistic is going to be ugly for you.
As for what Maarten said, it was a generalization. You know the best way to make him shut up? Prove him wrong. Because if more people building websites out there listened to Maarten (and built their website from a blog or forum engine instead of building their own), they’d be better off.
Right now there are 700 websites out there written in languages like Perl, Python, PHP, Java, dotNet and C that prove your statements about Twitter wrong. You might say, “Well they don’t use ActiveRecord. Or, if they do, they had to deal with the same scaling problems because if you understand the nuances ActiveRecord can be federated.” to which I say, “Umm, yes, that’s sort of the point of my article.” I think the whole thing is amusing. When I see all these sites trying to use Ruby to build the next MySpace, or Digg, or whatever. I’m going to shake my head. MySpace had a clever “out” for ColdFusion. What do Rails developers have?
We have hundreds of machines at our colocation, but we certainly don’t simply say, “Oh we’ll throw more hardware at it.” When you scale up, so do the returns on figuring out on how to save money as well as the costs when you make a bad architectural decision.
And before you think that I’m just lobbing bombs from my top-100 position (I am), realize that I have currently only one thing written on my wipeboard right now: It’s a list of website times of all the major social networks, and Tagged is the slowest by a large margin. (Even Friendster? Say it ain’t so.)
But you see? The difference here is that this is a price (in performance) I pay when I inherit a two+ year old PHP 4 ad hoc development system. PHP encourages that sort of thing and it’s part of the terrain of developing in PHP. At least my site doesn’t go down on a daily basis like Twitter.
Site uptime and site scalability are two consequences of Ruby on Rails development. That can be overcome, but if you’re trying to convince me that it’s simply a hardware issue or that I don’t “get” Rails, I’ll just stand on the sidelines, laughing.
I agree, PHP is great, but you have to be really smart to remember 3000+ core functions, totally inconsistent function names, and writing non object-oriented nonsense like $x = some_function(‘x’, ‘y’, $x) .. some of us just need something simple and logical.
@Peter: I could say that this is what IDEs and php.net is for. That with PHP5 there is oo extensions that work, and that even in PHP4 you had resources and the resource ID is usually first.
But instead I’ll say that I agree, because all the above talks around the reality that your point is completely valid. That’s a consequence of using PHP. See this.
“I agree, PHP is great, but you have to be really smart to remember 3000+ core functions, totally inconsistent function names, and writing non object-oriented nonsense like $x = some_function(’x’, ‘y’, $x) .. some of us just need something simple and logical.”
Absolutely, which is why you use frameworks — of which PHP (and Perl, and Python, etc.) has many — and/or strong dev tools, of which PHP has many (and more than most other dynamic languages).
I’d also argue that in general language simplicity, PHP is much simpler than Ruby (or Perl, or Python). That’s an advantage and a disadvantage depending on the context.
“LOL, you mean the WordPress, clone of MovableType, or I miss something? What will be next? Another clone.”
cough Ruby cloned Smalltalk cough
“Can we stop confusing “Ruby” and “Rails”, please? They are not the same thing.”
Yes, but, the context of Terry’s post was the comparison of Rails and PHP being done by self-important Rails folks and hand-wringing PHP folks. For example:
http://www.railsenvy.com/2007/5/16/hi-i-m-ruby-on-rails-part-3
And despite all the “right tool for the job” stuff they try to slip in post-video, the simple fact that they named their site “RailsEnvy” tells me otherwise.
If this is my 15 minutes. I’m in big trouble.
@Ed: I actually love those videos—they’re hilarious. The Java “JAR”s one is a classic.
Link from LeoLife.
I think that touches a sore point with me. My problem is that Rails is often over-advocated to the detriment of many people. I’m not necessarily saying that in those cases they should use PHP instead, I’m saying they should go to sourceforge.
Terry: “When JavaOne talks about Ruby do they mean Ruby or Rails?”
Actually they mostly mean Ruby, not RoR. You see there’s this crazy idea floating around the Java world that Java is not always the easiest thing to use to solve every problem. Most people who think this, also think that so-called “scripting” languages are usually the best solutions to those kind of problems that Java is not well suited for. This seemingly illogical train of thought has led to a scripting language fetish in Java: http://jcp.org/en/jsr/detail?id=223 .
Apparently some of these Java wackos have infiltrated Sun and convinced the mothership that the best of these scripting languages is Ruby. Thus Sun “bought” the JRuby (Ruby interpreter implemented in Java) development team.
It’s not just Sun either. The “Spring JAR” includes support for JRuby, allowing you to write an interface in Java and its implementation in Ruby. That’s obviously useful, right?
BTW, some of these same scripting language subversives have also found an audience at Microsoft. MS wants to support both Python and Ruby as .NET scripting languages. That’s one of the big appeals of Microsoft’s Flex alternative Silverlight. You can write client side code in Python or Ruby (or C# or VB.NET.)
Dear Mr. Chay, Your piece was provocative on two levels.
In a good sense, it pointed out that there are limitations to Rails development, particularly if scaling is/may be a problem. To suggest otherwise would be foolish and you also underscore the fact that PHP can be a valuable tool for building dynamic web applications.
You also point out that frameworks come at a price. And that this is true regardless of what framework you choose. Point well taken.
But given those caveats, frameworks may really help many developers. The amount of work that can be done far exceeds the programming capacity at most places I’ve worked. Frameworks that allow you to attack problems rather than plumbing are immensely useful. Personally, I really enjoy working with Rails and as an internal developer for a university, rails can handle any capacity the university community can throw at it. The real issue is handling limited resources. In the case of Yahoo and the other top sites that use PHP, the scarcity is a combo of bandwidth/computing power. PHP can be extremely fast. In many cases the scarcity is programmers and Rails/Symfony/Django can be quite adept at helping in that regard. The point is, and you alluded to it, is that one tool does not fix all problems. It is a valuable point that many in the Rails community would do well to understand.
On the other side of the provocative nature of your article, the tone you set came across as caustic, an I believe it can undercut the validity of points you try to make. I am new to your blog, so I must confess to not being up on the nuances of your writing and tone, but I wonder who your audience is. If its PHP folk, they probably don’t need alot of convincing. If its Rails folk, most sober Ruby/Rails folks will pass you by, and the Fanboys will get their pants in a knot. If its the Java/.Net crowd, they’ll likely take away that there are hot heads in the PHP and Ruby community, and since Ruby is closer to Java/.Net as a language, I might as well look at it (or Python) instead.
I guess my point is that while you make valid points about the limitations of Rails and the hubris of segments of the community, the tone came across as caustic and defensive, without acknowledging the strengths, which can serve to diminish your points.
@Michael: Good point about Ruby. However I’ll bet that there is more PHP apps using Java out there than Ruby. (Almost half our code base at Tagged is Java.)
Microsoft also is toying with supporting PHP in CLR (dotNET) in addition to working closely (paying) Zend to improve IIS support in PHP, so I think Microsoft isn’t particular on what they want to adopt and destroy. That’s their modus operandi.
If they can get OSS developers using Silverlight instead of SWF, then more power to them.
They won’t.
“BTW, some of these same scripting language subversives have also found an audience at Microsoft. MS wants to support both Python and Ruby as .NET scripting languages. That’s one of the big appeals of Microsoft’s Flex alternative Silverlight. You can write client side code in Python or Ruby (or C# or VB.NET.)”
At his php|tek 07 talk, Joe Stagner from MS also mentioned PHP in the .NET scripting langs and client-side Silverlight scripting. I’m not sure any particular language support is set in stone, though, except the usual MS candidates. I’d personally love to do it in Python, or anything other than JavaScript, really.
http://joeon.net/
“BTW, some of these same scripting language subversives have also found an audience at Microsoft. MS wants to support both Python and Ruby as .NET scripting languages. That’s one of the big appeals of Microsoft’s Flex alternative Silverlight. You can write client side code in Python or Ruby (or C# or VB.NET.)”
At his php|tek 07 talk, Joe Stagner from MS also mentioned PHP in the .NET scripting langs and client-side Silverlight scripting. I’m not sure any particular language support is set in stone, though, except the usual MS candidates. I’d personally love to do it in Python, or anything other than JavaScript, really.
http://joeon.net/
MS has been working quite closely with Zend on getting PHP and IIS to play nicely with one another, as Terry mentioned.
@tychay via linked article in this post: “There are way too many PHP Frameworks out there. Sure PHP-Nuke/PostNuke/XOOPS are great for making a website if you don’t know PHP or have design sense, but knowing any PHP is worse than useless—the more PHP you know, the more offensive they become.”
I’m glad someone finally said it.
Something that really bothers me is how many frameworks came out immediately after RoR for PHP that just tried to clone RoR, even down to passing arguments as ruby :symbols. Wtf? I don’t see how that helps PHP at all, or even produces a productive framework.
Would be nicer if these framework developers would focus more on enabling a developer to take advantage of PHP’s strengths instead of just trying to copy the next cool idea.
Having just finished the symfony book, I find that framework somewhat rediculous in just how much non-php you are creating. YAML is cool, but really whats so hard about PHP? The framework just has to eventually compile all that f-ing yaml bs into PHP anyways? Is it because it might be slightly easier to read that is the real advantage, or is it because RoR used YAML? Probably the latter.
Ilia Alshanestky just recently released some pdfs from recent talks, and I find it sad that many of his speed improvement tips going directly against many of the core ideas of how some of these new frameworks function (ref of using magic functions like __call). Whats the point of shooting yourself in the foot?
I think people have a hard time getting behind any kind of framework for PHP because of the reasons mentioned above. No one has bothered to make anything that directly takes advantage of PHP, unless you consider Rasmus’ no-framework framework: http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html
One of the best long posts I’ve read in a long time. I usually don’t read such long posts all the way through, which is somewhat interesting since I usually write long boring posts. This one isn’t anything like that.
Security Expert Chris Shifflet’s discussion.
@leo was amused.
“Ilia Alshanestky just recently released some pdfs from recent talks, and I find it sad that many of his speed improvement tips going directly against many of the core ideas of how some of these new frameworks function (ref of using magic functions like __call). Whats the point of shooting yourself in the foot?”
Very often, what makes for a useful, convenient framework is also what makes it show. Things like __call make the developer’s tasks much simpler, at the cost of some performance. That’s a typical tradeoff, and one that is often beneficial. It’s unlikely your site will require great performance, and if it does, there are a number of options that don’t require ditching your framework entirely. Now if you’re running Tagged, things might be a little different, but that’s really, really (seriously) unlikely.
You repeatedly talk about “taking advantage of PHP,” but things like __call are PHP features. What’s interesting with PHP is that an OOP/abstraction-heavy approach is very doable, but not required… and there are even some OOP-oriented frameworks that have very good out-of-the-box performance, like CodeIgniter. Many, many PHP frameworks are quite unlike Symfony, and you’re doing yourself a disservice if you dismiss everything outright.
But, I should say, kenrick has a good point about way too many people trying to make a Rails clone in PHP, I suppose to prove that PHP is “just as good.” You actually can’t do some fundamental Rails stuff in PHP, because Ruby can do a number of things PHP doesn’t support. I am glad that RoR made people more aware of the power of good frameworks, but some folks went overboard.
http://blog.funkatron.com/archives/development/you-cant-do-rails-with-php-and-its-time-to-get-over-it/
@planetmcd.com: Great points.
My counter is just that general frameworks navigate a very dangerous space between Scylla (build-from-scratch ad-hoc frameworks that are highly optimized for their problem space) and a Charybdis (download an application from sourceforge that is mappable onto the problem space).
Seen another way, WordPress is a framework for blogs and problems mappable to blogs. Sure it’s an ugly framework that is poorly coded (I won’t defend that), but it’s a framework nonetheless.
I linked this before, but read this again. Then realize that this guy’s business is built on Ruby on Rails. The thing he didn’t mention is we both think that Ruby on Rails has a lot of potential, we’re just trying to figure out where. When the hype levels off, the market will figure Ruby’s place. Personally, my bet is it’s somewhere with Rails applied to certain types of websites.
I don’t deny that generalized frameworks can be highly productive and are very attractive to good developers. And I welcome to be proven wrong in my statement that they have a narrow application (so far dotNet, J2EE, and Ruby on Rails are contenders).
I heard a podcast five months ago about this guy who created a bunch of websites originally in ASP.NET and later in Rails called docly, numly, etc. Part of me was very frustrated (I actually crashed my car), because the scale of their problem was laughable—it was basically a tiny website with 3 or four features which were themselves websites. But, the other part of me thought it made sense: if you are going to build a website for each feature, Ruby on Rails was the ideal framework to start up and would be a tremendous timesaver down the road.
But I wonder, how much of that was self-selection?
As for the tone being caustic. Yes, I come off that way. I actually mean to just have some polite ribbing at my fellow developers and a little attempt to push their zealotry button, and I expect them to respond in kind (the I’m PHP,I’m Ruby Get A Mac clone ads are a funny example). I’d apologize for the caustic parts but really it’s hard to hold me to a gold standard when I’m a self-described PHP terrorist and the person I’m railing against (pardon to pun) has a whole slide with the words “Fuck You” on it directed at people just like me.
If Rasmus had my tone, you might have a point. But he doesn’t. In fact, I haven’t even seen Zeev or Andi get that worked up either. It’s really a tiny vocal minority who do, and nobody outside of internals really has a clue what’s going on there. It’s really irrelevant. PHP developers barely can take Rasmus seriously—we always joke about which talk he’s going to recycle this conference, or where do you think the term Rasmussed comes from? Do you think we really care about soap opera that occurs on internals?
Do you think that anyone using Tagged cares that when I get a really difficult problem with the site I start cussing?
Personally, I don’t think so. Just as I don’t care much that Twitter is written in Ruby on Rails except that it means that it’s down most of the time.
@kenrick: I agree completely. I feel a good framework reflects the design philosophy of the language itself. CPAN and TIMTOWTDI; Ruby on Rails and convention over configuration; Cocoa and design patterns over inheritance; J2EE and (okay the jury is still out on that one
)
On the other hand nobody is holding a gun to my head saying I gots to use Cake or Symfony or whatever.
So I welcome the Cake and Symfony people to prove me wrong. They’ve actually got a lot further along that I would have thought to tell you the truth.
@Jacob. Thanks it’s appreciated.
@Ed Finkler: Excellent post. I actually had that link in an early draft of this article.
Pingback: tijs.org » Blog Archive » links for 2007-05-23
Another key point is that the top N% of PHP Developers use a framework, or homebrew tools to develop an application that can scale fairly easy.
The great thing about PHP is people can dive in and build web apps fairly easy (I’d LOVE To see someone teach themselves RoR without knowing little programming).
That’s also a bad thing because we get a lot of spaghetti code. CakePHP, Symphony, and the other “large” frameworks attempt to solve many of the worlds problems. But what happens when you only need 3 of them solved? Performance is killed.
I play with Codeigniter a lot (and use it when clients request full ownership of code – agreeing to the CI license). There are things it does that I like and hate, but it’s easy to get up and running and lets me do a lot of stuff my own way.
Pingback: You have to be really smart to code PHP! « Ramblings of a web guy
Pingback: developercast.com » Brian Moon’s Blog: You have to be really smart to code PHP!
terry, you crack my shit up.
Who be the Eggman? finds a welcome diversion in this article.
Mr. Chay, Thanks for the response. Point taken about the tone, everyone has a style.
I think we’re more in agreement than not on points. There can be Ruby-PHP love. One of the things that interest me about JRuby is the convergence of languages and tools. If you don’t like one or don’t have a tool/idiom in one, switch to the other. Not likely this’ll happen in PHP anytime soon, but I’d be interested to hear your perspective on that alignment. I know Java’s a good deal faster than Ruby, and I came from a Java/Oracle shop so I’m pretty comfortable with it, but as I mentioned, my background was where the scarcity was the programming time, not speed of app, so I’d be interested to hear your thoughts.
Again, I agree about the attitude of some is a concern in the Rails community. On the one hand, its annoying to hear a bunch of kids act like they know it all because they know alot about one thing, but on the other hand, I knew it all when I was 22 too.
@planetmcd.com: A problem with Rails is that it isn’t the language that doesn’t make it scale—PHP is actually one of the slowest languages in terms of performance—it’s the design.
On the other hand…
MySpace built their site in ColdFusion. At around 15 million users they used a tool that rewrote their ColdFusion as C#. My first thought was, “wow, they managed to scale CF to 15 million users?” My second thought was, “That’s brilliant.”
As for running Ruby on PHP a la JRuby, that’s probably pointless. First the philosophies are quite different and second both languages are very slow. I think there are a lot of good ideas in Ruby worth stealing and I’d not be averse to binding my PHP code to future successful Ruby projects. I hope the Ruby people feel the same, but the general attitude among some prominent members of their community is one of cocky myopia and excommunication of the rest.
As for PHP in other environments. It’s not like people don’t want to run PHP on Java or PHP on CLR or PHP on Parrot. In fact there is a pretty popular active project getting PHP to run on Java. I think that there are two differences that make it more difficult than it would seem.
The first is that PHP is more than the core language, when we mean PHP we mean it and the satellite of extensions and practices we do in it. Many of those extensions are essential but don’t play nice normally (they can’t be threaded, etc.). Compatibility is a big chore and some of the side effects of the language are poorly documented.
The second is philosophically PHP is about gluing other things together. It is rare that an application needs performance on its web tier: it does, however, need scalability. PHP trades off the former for the latter. When PHP hits a performance penalty, the way to handle this is to push it outside PHP to another layer in an application or language that solves that problem already. Many other languages and approaches advocate copying good ideas. PHP tries to steal.
I’m not saying it’s impossible, I’m saying it’s extremely difficult.
@Ed Finkler – yeah the magic methods are a part of PHP, but I think my point should have been that while they are a part of PHP core, the inherit fact that they have to do guessing (lookups et al) just like __autoload and even include for that matter (unless you use full paths) is gonna make everything a little bit slower. On small sites that doesnt make a big difference I don’t think, but if try to make a large site, you start to feel that hit faster. I think you agree with that.
I see frameworks as a whole crippling developers more these days then helping them, especially where the barrier to entry is that ‘you don’t even have to know {ruby}’ you know? There is a whole book on Ruby For Rails, just because so many fools picked up Rails before learning Ruby and are now fucked because they don’t know why their app does x/y/z because DHH didnt make an ActiveRecord method called take_head_out_of_ass(:self).
People should know the language before the framework would be my argument. Hiding things from developers is not necessarily a good thing (even if it seems convenient at one point in time).
I really really didn’t get the point of this post.
Was this RoR bashing? Was this PHP praising? What the hell was this?
Was the bash-microsoft-and-dot-net party changed to bash-ror, and I got an outdated invitation or something?
Don’t you have anything better to do? Don’t you consider yourself a smart fella that is using that language Yahoo is using and writes scalable websites everyday? If you do consider yourself such a person … how do you have time to write such mustarbatory blog posts that contribute nothing about nothing to nothing?
Really, if you will provide with an explanation to these questions – the that is probably only proof that you really like to waste yours and others valuable time.
Regards,
Pingback: Get Over Yourself: Your App Is Not Going to Be the Next Twitter | On Web Apps
Well written post.
The Rails community should basically expect this kind of stuff now that they have passed being the underdog phase.
My response though: http://onwebapps.com/get-over-yourself-your-app-is-not-going-to-be-the-next-twitter/
Not all cute girls are blank starers, I promise. The flip side is though, that if I don’t know exactly what someone is talking about, they are in for 200 + questions because I’m not about to walk away without getting smarter