Email address validation: please stop

It’s something that’s been bugging me for a long time. All around the web, people are making flawed attempts at validating email addresses, causing a headache for their users, and probably for themselves.

I really started to notice this when I began to use the disposable addresses system that Gmail provides. Any mail sent to <youraddress>+<some_other_string>@gmail.com arrives in the Gmail inbox for <youraddress>@gmail.com. This is quite handy, and I personally use it for automatically tagging email I receive. For instance, for any email related to unicorns, I’d simply enter “<myaddress>+unicorns@gmail.com” on the sign-up form, and my mail filters would automatically tag all mail sent to that address for me (as an aside, these don’t really work as “proper” disposable email addresses as it’s easy to just strip everything after the “+” character in the local part of the address, and get the proper address). Sounds great, right? Well it is, until half of the internet fails at email address validation and rejects it.

The problem is that the email address specification allows for far more than most programmers expect it to. For instance, things like ” ! $ & * – = ^ ` | ~ # % ‘ + / ? _ { } ” are all valid, along with a whole bunch of others (even “@” if you quote or escape it). Some of these are a tad silly. Using another “@” sign by escaping, for instance, is just confusing, and is probably only used by sociopaths. Reject some of those others however, and you’ll start to annoy your users.

I was recently at a talk given by Andrew Godwin at FOSDEM. In that he mentioned a problem Django ran into, where their regular expression used for email validation would hang on long input (scratch that, I think this is the bug he mentioned, that other one is hideously old). After some head scratching, they came up with an improved regular expression, which didn’t have the issue. I’m not sure that either solution actually validates according to the specification though, and if the validation falls on the side of being too strict, it’s probably out there irritating people right now. As a fun aside Perl’s Mail::RFC822::Address module gives you a glimpse at a regular expression that actually follows the specification from RFC822.

Even the best validation is only going to get you a syntactically correct email address, with no guarantee that it actually exists. If you want to know that you’re being given a valid address, send it an email and have the user click a validation link in it, and stop annoying your users!

EDIT: I wrote a little follow up article on some of the points raised by commenters.

The Result of our own Perversity

Yesterday was a field day for TV broadcasters, as they were handed another opportunity to fill our screens with horror of rolling news. We were treated to all the mundane detail of the stand-off between armed police and gunman Raoul Moat. Anyone who had been within half a mile of the incident had a microphone thrust into their face and was expected to provide us with some new interesting titbit of information. In reality they provided such useful insights as “Yeah like…he’s got a gun…I’m knackered man.” (an approximation of a statement from passing cyclist). We also got an opportunity to watch a woman break down into tears over her mum (or is that “mam”, as the news readers picked as their new, dialect-friendly pronunciation for the day) being stuck in her house, fearing for her life. Not that these people are to be blamed. Their reactions were normal, it’s just that some deluded producer decided that they were worthy of national broadcast.

There was no safe haven from this. No news broadcaster would pass up on such an opportunity. Even the BBC looked like it had slumped into tabloidesque coverage, complete with flashbacks to the earlier, more dramatic scenes later on in the evening when there was nothing more to say. Though in this case “dramatic scenes” is a complete misnomer. Said scenes consisted of a mobile phone conversation that never seemed to end (which, oh joy, they played repeatedly through the night), dull comments from a few people who happened to be walking past as police moved in, and the aforementioned woman in hysterics. But hey, at least watching her gradually lose composition was fun, right?

The problem is that not only have we become accustomed to this type of coverage, we actually crave it. It brings some excitement to the day, as we peer in on an unfolding drama, like a neighbour peeking over the fence while next door have a good row, but from the comfort of an armchair, plonked in front of the telly. I’m not trying to claim innocence here. I got in from work, saw that there was a media shitstorm in progress, and immediately headed for the remote. It was something to take my mind straight off the day, and it passed the time while dinner cooked, or so I thought. I hardly felt calmer from watching it, and those sausages were just a tad more cooked than I’d planned. In fact, all that happened was that my evening was consumed by sloppy, poorly constructed coverage of an event with an outcome we all knew was coming. Just think of all the things I could have done instead. There was at least enough time for five or so episodes of The Good Wife (which I’m currently watching, and so should you be).

It’s our own fault though; we deserve every one of these media frenzies. They know that viewing figures will skyrocket, and that if they dedicate a section of the morning paper to a minute-by-minute breakdown they’ll have no problem shifting thousands upon thousands of copies. It’ll be the level of coverage we receive for as long as we remain ready to consume it. It’s just a shame nobody dangled a microphone down to Raoul so we could get his opinion, imagine that, we’d at least get a few complaints to Points of View to laugh at. That said I don’t suspect even he could have added a great deal to what we already knew. “Well there have been a few people come past, there was this cyclist bloke who looked well knackered. Anyway, I digress. I’ll fucking shoot the lot of you!”

Next time I’ll find out in the morning. I won’t bother staying tuned for a dragged out phone interview, some shaky footage from a mobile phone camera, or an explanation from a firearms expert (“Well you see, you point the gun at something you don’t want to be alive much longer, and then it isn’t”). I’ll turn it off and do something vaguely fulfilling. Alright, that’s a lie, but I’ll feel at least ten percent more guilty next time I slip up and watch this crap. Happy now?

Google are stealing my privacy!

I had my attention brought to another blog post earlier today (which for the purposes of this post, I shall assume you have read). Initially, my thoughts were that Google had gone and committed a rather large error, but I didn’t look too far into it as it wasn’t going to affect me and really had to set off towards home. When I arrived back I started talking about it to a friend, who immediately put me right. It turns out that Google Buzz is not exposing any new data to anyone without being allowed to. It is in fact aggregating already public data into, in my opinion, a pretty nice format.

What has happened here is a complete misunderstanding. Following the main example from that post (though it’s completely true of other services which Buzz can import from) Google Buzz will only display shared Google Reader items and comments that you publicly share. If these are private, then Google Buzz isn’t going to ruin your day and wave them around publicly.

To top this off, within Buzz there is actually a link (under Connected Sites, select Edit next to the Sharing With column) which takes you straight to the privacy options page, where you can go back and fix your earlier mistake of not correctly choosing your privacy settings. I’d actually say that, far from revealing your private data, Google have done a reasonable job of letting you protect your privacy in this case.

The hype that this has generated is rather saddening, and a reminder that people are all too quick to jump on the bandwagon. The author has posted a follow up, with a bit more explanation and as it turns out, a confirmation from Google of what I have focused on here (though this doesn’t have too much attention brought to it).

Mirror’s Edge (PC) Review

I picked up Mirror’s Edge in the recent Steam sales (along with far too many other games, which saw off a little more money than I’d hoped). I didn’t get it with any of my own expectations, only the knowledge that people had told me it was a must buy. Unfortunately the game left me wondering what had deluded these people into thinking something like that.

If you care about the story not being spoiled you may want to avert your eyes. The game starts with you being plonked down on a roof somewhere in some city where the graphical bloom goes up to 11 and stays there at all times. You’re taught your repertoire of jumping and fighting techniques in one go, god forbid you should forget them, and then launched into the game. The story is set in your regulation future dystopia, where the police are evil, the government are evil and concrete blocks are extremely springy. You’re not really given too much motivation to hate the government; you just take the game’s word for it and set about acting like a royal prick with a poorly explained briefcase fetish.

Sadly, the game play doesn’t even come close to making up for the plot. There is one route, and only one route, and any deviation from it will result in crunchy death as you faceplant into the pavement. Most of the time this route is helpfully painted red, but the game occasionally decides you’re more competent than that and lets you decide what to do. Don’t be fooled though, there’s one path, and any attempt at creativity will be duly rewarded with death.

Linearity aside, the game still manages to produce an unnecessarily frustrating experience. Every time you grab an object or ledge, you’re treated to a face full of concrete and have to stop and move the camera around, breaking the flow of the game. This, teamed up with the loss of momentum every time you jump over anything higher than a cinder block, caused a steady feeling of rage which didn’t really subside at any point in the game.

The lack of choice in paths reared its ugly head more than once during the game, but one incident stuck out more than the others. In a section in chapter 7 the character is running on top of some ventilation shafts and some pipes are highlighted red on the other side of the room. I spent a good half hour wall running along the wall that headed directly to them, only to be left disappointed at the game’s edge detection and plummeting to an inevitable death. It turned out that I was meant to run along a wall parallel to what I was aiming at and make possibly the most hilarious jump ever to reach the bars.

The edge detection was a constant annoyance. At times it seemed like the protagonist simply wasn’t trying, but as soon as a bit of concrete turned red it may as well have been a fucking spring board. The net result is that you only go where the game wants you to go, no matter what incredible leap that may involve. Occasionally it will even help you when you don’t jump far enough, and you’ll end up performing a mid air vault for a pipe or ledge.

Overall, I’m confounded as to why people recommended this game so highly. While it’s a nice concept, it’s totally marred by a lack of polish (no, not bloom, there’s enough of that) in the execution. Bring on the release of Assassin’s Creed II on a real platform.

iPad: Why?

Following the usual excess of hype that lead up to the launch of a new Apple product, I can’t help but feel completely underwhelmed. I’ll be honest, I’m not a user of any Apple products; however, I’d be lying if I said I didn’t like any of them. The iPod is a nice music player. Having used a few friends’ I can say that I like the UI and that there was no huge learning curve to using the device. The iPhone was certainly responsible for pushing the idea of smart phones to a greater audience and once again did so in a nice tidy package that was very usable.

The iPad though, leaves a lot to be desired. It seems like Apple have produced an enlarged version of the iPhone (but not a phone, so really more like an iPod Touch), without applying significant work to it. It suffers the same issues as the iPhone, those being:

  • A total lack of multitasking. Running applications in the background is not a new concept, and failing to provide such functionality seems like a massive step backwards. I’ve felt this about the iPhone for a while and it seems even more crippling for a device which truthfully should provide more.
  • No camera included. While it’s obvious that this device isn’t for taking photos, I don’t understand why it doesn’t have a small, integrated webcam on the front. Being able to make video calls on, for instance, Skype seems like a reasonably sensible use-case for this device.
  • Lack of a hardware keyboard. This is a more debatable point, but to me it makes little sense. With a device of this size I don’t envisage that an on screen keyboard would be pleasant to use. Selling a keyboard dock isn’t really a solution as you’re just increasing the amount of clutter that you have to carry with you to use the device as you want to.

I’m left not really knowing who this product is aimed at. Which group of people want a larger iPhone whose main advantages are negated by dodgy design decisions? It seems more  like they’re simply riding the wave of success which means that people will end up buying them simply because it’s the latest thing to emerge from the shinies factory.

Battle.net: Migration woes and design failure

Blizzard have decided that it’s time to force people to merge their World of Warcraft accounts into their battle.net accounts. In itself I believe this is a sane idea, and possibly one that is overdue (the option to do so has been available for quite a while, they only just started forcing it onto users). In itself this has caused a few problems for people. I’ve had a few reports from friends of the site giving some sort of error whenever they attempt the merge, and I’ve been completely unable to access the site on a couple of occasions. Overall, it seems that after a bit of persistence people have managed to perform the merge and log into their WoW account.

My second gripe (and only other so far) is the ridiculous way that account security is handled. Something which is probably never an issue for most people just went straight to the top of my list. It turns out that if you forget the answer to the security question on your account there is no way to change it. That’s correct, even as an authenticated user you can’t change this setting. In itself I wouldn’t have cared about this. I’m not a moron, I can remember my password (although apparently not my secret answer, yes I do appreciate the irony in this). However, in their infinite wisdom they have decided to require this answer to change the email address associated with the account. This leaves me in a rather crappy situation. My account is associated to an email address that I’m trying to move away from and I’m being denied the option to do so.

What infuriated me at this point was the response I received to my support request. It contained the following: “The problem you were experiencing is now resolved and you should be able to use all the features of your account now.” For some terrible reason this got my hopes up, but it turns out it was some canned bullshit. The website has not been changed to allow this, and I’m still in the same predicament. I’ve sent a reply, but I don’t hold a great deal of hope for it getting a proper response. If it carries on like this I’ll give them a call and see if their phone support is any better.

I’ll write more when there’s some advance in the situation, but for now it’s a case of waiting.