May
30
Some thoughts on PHP advocacy
Filed Under WebDev | Leave a Comment
These days, PHP is being taken more and more seriously as a professional web development platform instead of just a simple scripting language for quick & dirty web hacks. However, one of the main strenghts of PHP, the diversity of it’s community and it’s low barrier to entry, also leads to the kind of shallow, badly informed PHP advocacy we can do without.
Nate Abele’s talk on CakePHP at this weeks Kings of Code conference, with it’s baseless dissing of Rails and personal attacks on DHH, led me to think we could use some basic guidelines for
spreading the PHP gospel.
So here’s a start. Feel free to critize/contribute:
- Thou shalt not dis Ruby on Rails. Rails is awesome. Repeat after me: “Rails is awesome”. So let’s learn and steal from it as much as possible.
- Thou shalt not dis Microsoft. Microsoft sometimes does awesome stuff. Okay, I’m not gonna make you repeat that. I feel dirty enough typing it. And no cute Blue Monster is going to stop them from being evil either, but you can still be evil and do cool stuff. Think Tom Cruise.
- Admit PHP is one of the most inelegant, inconsistent languages every invented by mankind. Or as Jeff Attwood put it recently “PHP isn’t so much a language as a random collection of arbitrary stuff, a virtual explosion at the keyword and function factory“. Don’t argue about PHP on the basis of elegance, structure and logic. You’re gonna loose. Besides, do you really want to waste your time on a “yo’ momma dresses you funny” argument with language design purists when you could be coding the next Facebook?
- It’s not about making PHP ready for the “enterprise”. That’s just the sales pitch. It’s much more about making the enterprise ready for PHP, and the culture and values of the web that come with it.
- PHP4 is dead. Bury it already. Don’t take it out on stage and show it to the world pretending nobody’s gonna notice the funky smell. (That even includes you, Matt Mullenweg…)
- Native performance is irrelevant. Seriously. Screw the benchmarks. If you absolutely, positively have to squeeze every inch of processing power out of your servers, code in C. Otherwise, learn about architecture and how to cache the crap out of everything. The chance that native language performance is relevant for your web application is very, very small, so stop arguing about it.
- PHP doesn’t begin and end with Zend. PHP is neither a language nor a product. PHP is a above all a community. PHP is you. That’s why PHP rawks. Because you do.
May
2
A lot of non-developer blogs are writing about Twitter’s scaling issues, and the possibility they may ditch Ruby-on-Rails. The good thing is: the relevance of technological choices is finally being made visible for a (slightly) broader audience. The bad thing is: it’s largely being simplified to a “does platform X scale” issue.
Now I’m not going to defend the use of RoR, because I think it’s a naive choice to use relatively unproven technology for a project like Twitter. And I’m certainly not going to join the choir of clueless RoR fanboys who believe just using RoR makes them more professional developers. At least most of “our” PHP scriptkiddies are clueless without the major attitude problem…
But RoR is not the issue here. Virtually every platform can scale. You can probably write Twitter in VBscript and make it scale. Just as long as it allows you to cache the crap out of everything and optimize and de-normalize the database-interaction, you’re pretty much set.
Unless you’re looking for out-of-the-box “enterprise” scalability, which in practice means “keep adding more hardware to achieve mere ‘acceptable’ performance”, creating a scalable web application is a matter of architecture rather then platform choice. If the platform you choose allows you to tweak every inch of your app, and mix & match various technologies best suited to solve particular issues, there’s no reason why your app won’t scale. Many high-traffic websites for instance have bits and pieces coded in C, and/or certain services running on highly tweaked servers just to solve particular bottlenecks. It’s only if your technology of choice is so monolithic doesn’t allow for such hacks it becomes a blocking issue. This is a serious risk when choosing not only a particular programming language but an entire framework, but most frameworks will allow you to work around it if necessary.
The key is not to let your entire application depend on one single platform or vendor, and work on the principle of “small pieces, loosely joined”, in which the pieces can be made from any technology that scratches your itch*). Which by the way seems to be exactly what Twitter is currently doing.
*) This is of course one of the main reasons why Microsoft sux so very badly for web apps, but even Microsoft seems to have figured that out by now.
May
2
A personal gift
Filed Under Netlife, WebDev | Leave a Comment
On my way to work I saw a girl distributing free newspapers as if they were a personal gift. Brilliant. We should aim to build websites that give people the same feeling. (Sites like Pownce and Flickr sometimes get close. Probably no coincidence they’ve got female (co-)founders.)
Free newspapers are still a crap waste of paper though.
