58 points · by afterz · 16y ago · 108 comments
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.
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.)
PHP was invented so that designers could add a <p>Hello <b>Martin</b></p> and think it was cool that their homepage showed different names based on who you were. For most people basic functionality and the ability to connect to a database is more than enough. You can probably write up more than 90% of all webpages without using closuers, lambdas, recursive functions, object oriented programming and what have you. And the people who write these webpages don't care about programming at all, they just want the job done. These quotes from Rasmus shows where he's coming from.
You can of course argue that people shouldn't launch webpages if they don't know what they're doing, the terrible safety concerns of letting idiots code stuff for the web, etc. but it would be like scoffing at people who don't drive an extra souped up Ferrari Enzo - very arrogant. Some pople just want to get from A to B. These are the people who use PHP. And incidentally they are also the people down in the trenches actually building all the little sites that make the world go round.
Oh, come on. Give me an instance where PHP is the right tool.
This argument is so overused that I don't even know what it means anymore.
And no, shared hosting doesn't count. My personal hosting plan costs something like $10 a month and I can choose between PHP, Python, Perl and Ruby (with Ruby it is more difficult, since I have to ask the sysadmin to add a couple of Mongrel instances for me). But mod_perl and mod_wsgi are there by default.
> <p>Hello <b>Martin</b></p>
Dude, that doesn't have any PHP code in it. To make this dynamic, you still have to have some way of authenticating and storing info about users. And you'll also want some way to edit those users.
Do you know how easy it is to create a simple CMS in Django, with authentication, and a functional admin? ... it takes only a couple of hours to a beginner that never worked with Python or Django before (yes, I saw one in action).
When PHP appeared, it made sense since Perl was the only game in town, and it was a bitch. But things have evolved a lot since then (even for Perl). For me, PHP doesn't make any sense.
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.
The only thing that saves them is that most php users have no clue of what they are doing, have not training of any sorts, and no nothing but php and maybe perl, vb or whatever.
[1] Okay, I'm exaggerating and the latest iteration is no longer the menace it once used to be.
* 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")
This has been described in detail thousands of times. Google it.
So why are there so many crappy PHP developers? Because anyone can make it do something approximating what they are envisioning it doing, no matter the skill level. That seems pretty powerful to me. And, in the end, it's really about the results instead of how one necessarily got to those results. You can't make money if you don't deliver a product. And if history is any indication, only a tiny fraction of the masses care about quality. The dominance of Wal-mart and MySpace are proof of this. My guess about your guess is those millions of lost man-hours have been made up with the millions of hours beating competing products to market due to the rapid nature of PHP development. I mean if we are throwing around unverifiable assumptions, let's do it, let's get crazy with it.
"A determined soul will do more with a rusty monkey wrench than a loafer will accomplish with all the tools in a machine shop." - Robert Hughes
* CGI (mostly done with Perl).
* mod_perl (a huge ungainly mess)
* ASP (no thanks, not a Microsoft guy)
* Various proprietary things
* Various niche players (my own mod_dtcl [later Apache Rivet] was faster and IMO, nicer than PHP, but never got more than a modest amount of traction).
By the time I even started writing mod_dtcl, PHP was already pretty widely used, and we were using it in production at the company I worked for, and it was certainly better/faster than doing things in Perl CGI's.
These days, I really, really, really don't like having anything to do with PHP after having dealt with too many unholy messes, but I can't deny that it got some critical things right at the right time.
Speed in a shared hosting environment. I've read about developers running multiple commercial sites from a single Dreamhost account e.g. http://www.pseudocoder.com/archives/2009/01/04/how-much-mone... . That's not realistic with Java, RoR, or Perl.
So I assume PHP no longer has the performance advantage of integrating closely with Apache.
In fact, since Dreamhost now offers Passenger (AKA mod_rails) as a solution for running Rails and Django) PHP might be at a disadvantage. Especially when paired with a large framework (zend,codeigniter,cake, etc.)
Defining good is always tricky, but being chosen by many people when other good choices are available is not a bad test for certain definitions of good.
Choices may not always be %100 rational. They are usually not random.
Most people seem to miss the role that time plays in language choice. PHP's very far from the best choice for webapps now, but it was the best choice when it was invented in 1995, and even for a while afterwards (such as when FaceBook was created in 2004).
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 :)
But I don't think any of them have anything to be proud of: http://www.steike.com/code/php-must-die/
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.
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.
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.
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.
Maintaining PHP apps can be a pain and the language isn't the prettiest to work with.
However, PHP has created a world where millions of people can create basic web applications, which has led to the creation of tens of millions of new sites and applications, some of those which have changed the world.
PHP has allowed more people to code, which has allowed the world to test many more ideas, many of which have created tremendous value that I think far outweigh the costs.
- A world that has PHP and enabled web developers.
- A world without PHP in which only Java EE-enabled engineers can write webapps.
I think that's a demonstrably false assessment. A language as poorly designed and implemented as PHP isn't necessary to be accessible to "millions of people" -- in fact, does the opposite in enabling them to make serious and expensive mistakes.
I don't think it's fair to blame bad programming on the language itself.
>Do you know how many aggregate human lifetimes are wasted on the simple act of regularly upgrading PHPBB, WordPress, MediaWiki, et al?
Software written in other languages doesn't require upgrading?
Think of all the cool stuff they could have been inventing had they not needed to look up the name of strfind(?), and whether it takes the needle or the haystack first.
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.
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.
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.
and the HN thread: http://news.ycombinator.com/item?id=1043400
I don't think he's a happy person, either.