Latest posts

Wag.gd - short URLs with a point

Short URLs are a bit of a hot-button topic amongst devs - some think they're useful (like Russell), some are wary of them (like me) and some, like my friend Simon, rail against them as a waste of time and resource.

Simon, however, is a sensible sort so rather than just making lots of noise about how they suck, he's gone away and tried to think of a sensible use case, then implemented it.

So take a look over at Wag.gd if you're interested in mobile development. Simon's written about it far better than I could and it's certainly an interesting idea.

Why you should close PHP sessions as soon as you can

When serving files with PHP, you may notice a curious effect where only one request gets served at a time per user.

You can see it if you're the kind of retro throwback who uses framesets served via PHP - the panels will load in one at a time. You'll see the same thing if you generate a load of images via PHP - they'll pop up sequentially - and if you serve large video files via PHP like we do at work you may see a curious effect of the downloads queueing up. Those of you with AJAX applications may be victim to this without realising, but if you're serving JSON/XML responses from PHP scripts you'll find that your parallel AJAX requests will only get served one at a time.

I've seen this effect a few times and always ended up working around it. The odd thing is this isn't a setting in Apache or a global slowdown of your server. PHP just refuses to serve more than one request per user at a time. Luckily Kevin managed to spot the reason, and it was a new one on me even after 9+ years of using PHP (it's possible everyone else knows about it, mind you).

The answer is pretty simple: PHP can only handle one response at a time if you have an open session.

FoWA London 2009 Round-up

FoWA London

I was lucky enough to go along to FoWA this week with a couple of my colleagues, so I thought I'd do a quick round-up of the two days.

I really enjoyed the conference overall - Kensington Town Hall was pretty adequate for the size of conference, the afterparty at Orchid on the Thursday was fairly epic, and the talks left me really energised about the state of web applications in general. The only slight blot on the whole thing was the terrible state of the WiFi, which was unusable on the first day and pretty flakey the second.

Rather than going through it in strict chronological order I've grouped the talks into broad themes. When the videos turn up online I'll try and link them through.

Doctrine article in php|architect

Ah, fame at last!

Cover of php|architect

The latest issue

It looks like the new issue of php|architect is out, and contains my article about Doctrine, the PHP-based Object Relational Mapper.

It feels like ages since I wrote it (I'm no longer a 'freelance PHP developer' for a start) so re-reading it was actually a slightly weird experience.

It's my first published work, and I'm fairly happy with it. Hopefully I'll get another chance to write for php|architect, I just need to think of another subject that I have something to say about.

The bad news for most of you cheapskates is that php|architect is a subscription-only publication so you can't read my article for free! However, I would genuinely recommend the magazine, especially as it's only effectively $2.50/issue. Obviously I wouldn't recommend it for people who aren't interested in PHP, however!

A quick update on my life

Seeing as I'm updating, here's what's going on with me lately:

  • I've written an article for php|Architect - not sure if I'm meant to say what it's about, but it should be in the August issue.
  • I left PropertyMall after four years, to move on to pastures new as a freelancer.
  • After 6 weeks of contracting, and enjoying the freedom, I had a couple of interviews at Beam.tv.
  • The upshot of which is, I'll be starting at Beam on Monday! I'm very much looking forward to it.