@Media Ajax

@Media Ajax logoI was at the conference @Media Ajax conference last week. In hindsight, “@Media JavaScript” would have been a better title, though. It is less than two years since Jesse James Garrett coined the term “Ajax”, but we are already at the point where Ajax development is just the way we do things now, rather than something that needs to be explained, discussed, and evangelized.

During the wrap-up panel at the end of the second day, one of the questions was directed to the audience: who would have attended the conference if it had in fact been called “@Media JavaScript”? Most people put up their hand. I would not be surprised if Vivabit run a sequel to this conference next year; but the main reason for them to keep the term “Ajax” in the title would surely be to make it easier for developers to convince buzzword-hungry managers to let them attend.

Monday 19 November

Keynote presentation: “The State Of Ajax” by Dion Almaer and Ben Galbraith

Dion AlmaerBen GalbraithThis presentation set the scene for the rest of the conference, briefly covering subjects like JavaScript 2 and the heated politics surrounding it, the emergence of offline support for web apps (Google Gears) and runtimes with desktop integration for web apps (AIR, Silverlight), and the evolution and convergence of JavaScript frameworks. Their demonstration of Google Gears’ WorkerPools was an eye-opener for me; I hadn’t realized that Gears was about so much more than offline storage. They closed with a reflection on how Ajax has transformed our expectations of web applications, and how it is enabling a more attractive web.

(Note to self: get more familiar with Tamarin, ScreamingMonkey, Google Gears, AIR, HTML5, Dojo, Caja.)

“But I’m A Bloody Designer!” by Mike Stenhouse

Mike StenhouseMike talked about how in modern web development, the traditional barriers between designers and developers are breaking down. Designers need to be aware of the consequences of their choices, and how things like latency and concurrency will influence a feature. Developers need to increase their awareness of interaction design. This led to a discussion of how he feels thatBehavior-driven development has made him a better designer (and developer). He mentioned WebDriver for writing and executing BDD test cases, but the demo code he showed looked more like Ruby… I think I missed something there. Good tools and techniques to explore, though.

Update:: RSpec?

“Real World Accessibility for Ajax-enhanced Web Apps” by Derek Featherstone

Derek FeatherstoneProviding good accessibility for web content is hard enough; once you start building dynamic web apps, you’re practically off the map. Derek took the zoom/move control in Google Maps as an example of bad practice, showing how difficult it is for someone with only a voice interface to use. He walked through some more examples, with useful advice on how to make improvements in each case.

One of the toughest problems for Ajax applications is how to inform screen readers that a part of the screen has been updated. Derek noted Gez Lemon and Steve Faulkner’s technique for using the Virtual Buffer as being one of the best options for tackling this right now. Another cool technique that I hadn’t seen before was updating an input field’s <label> element with error information when the form is validated (so that a screen reader is made aware of the change), but then using CSS positioning to display the error information where a sighted user would expect to see it–possibly on the other side of the field than the label itself. Very clever.

I’m also going to have to familiarise myself with the ARIA (Accessible Rich Internet Applications) work coming out of the WAI: ARIA proposes to extend (X)HTML with additional semantics that would allow web applications to tap into the accessibility APIs of the underlying Operating System.

“How To Destroy The Web” by Stuart Langridge

Stuart LangridgeAfter lunch, Stuart Langridge put on his Master of EVIL hat, and tried to coax us to join him on the Dark Side by teaching us about all the things we can do to make a user’s experience on this hyperweb thingy as shitty and 1998-like as possible. Remember: if your app doesn’t use up all of a user’s bandwidth, they’ll only use it for downloading…well, something else. (“Horse porn” sounds so prejudicial.)

(Stuart’s slides lose a certain something when taken out of context.)

“Planning JavaScript And Ajax For Larger Teams” by Christian Heilmann

Christian HeilmannChristian works for Yahoo!, and has for a long time been a great evangelist of unobtrusive javascript and other modern JS techniques like the module pattern. In this presentation, he talked about working with JavaScript in larger teams. This is interesting, because until recently, there were no such things as “large JavaScript teams”. JS was something you copy-and-pasted into your web site, or got your resident front-end geek to bolt on as an afterthought. JavaScript has matured enormously over the last few years.

Many of Christian’s points are good software development practices in general: comment your code, follow a code standard, work as if you will never see your code again, perform code reviews, use good names, etc. Take five minutes to read through Christian’s presentation slides (they’re very readable and comprehensible, even out of context), and then take another five minutes to think about them. JavaScript is a first-class citizen of web development now: let’s treat it as such.

(Note to self: make more use of the BUILD PROCESS.)

“Ajax A Work: A Case Study” by Peter-Paul Koch

Peter-Paul KochPPK wrapped up the day with a case study of a genealogy/family tree application he is building. He walked through the decision processes behind:

  • building the app as an Ajax app in the first place
  • choosing XML instead of JSON (or HTML or CSV) for its data format on the wire
  • deciding on an optimal loading strategy to ensure a highly responsive user experience

Interestingly, PPK was the only speaker who used the “strict” definition of Ajax (i.e. Asynchronous JavaScript and XML) as the basis for his presentation. I didn’t agree with all of the decisions he described, but it was an interesting view anyway. (And besides, it’s not my app 🙂 His write-up of the conference, as well as his slides, can be found on his Quirksmode blog.

Tuesday 20 November

“The State Of Ajax” by Brendan Eich

Brendan EichBrendan Eich is the man who invented JavaScript. There are few mainstream languages that have both been adopted so widely, and dismissed out of hand by so many. In the keynote presentation, Dion and Ben characterised Brendan Eich as wanting to use the JavaScript 2 (ECMAScript 4) spec to “just let him fix his baby”. That’s a pretty crude caricature of Brendan’s position, though. He is very keenly aware of all the problems in JavaScript as it stands right now. (And there are some really big problems.) With JS2 he is trying to take the best bits of JS1, and build a language for the next 5-10 years (or more) of the web.

However: JS2 really is a different language. It adds new syntax, and it will not be compatible with existing interpreters. The other side of the “future of JavaScript” debate wants to see incremental improvements to the current implementation(s), so as to maintain compatibility and not “break the web”–because we’re still going to be stuck with IE6 for a long time to come.

I’m not going to run through the technical guts of all the things going into the JS2 spec–there are just too many of them. Take a look at Brendan’s roadmap blog to get pointers to what’s going on.

“Building Interactive Prototypes with jQuery” by John Resig

John ResigThis presentation did exactly what it said on the tin: an introduction to coding with jQuery. It appears to be compact, simple, expressive, and ideal for a lot of everyday JavaScript work.

“Metaprogramming Javascript” by Dan Webb

Dan WebbDan showed how to use some of JavaScript’s best features (prototypal inheritance, expando properties, using Functions as Objects, etc.) to produce some surprising results. Because of these techniques, JavaScript really is a language that can bootstrap itself into a better language. Very slick.

(See the slides for the presentation on Dan’s site.)

“Dojo 1.0: Great Experiences for Everyone” by Alex Russell

It appears that no @media conference is complete without a doppelgänger. I hope I’m not the only one who sees the obvious resemblance between Alex Russell and Ryan Reynolds. (Photo of Ryan Reynolds shamelessly lifted from Tharpo on Flickr.)

Hollywood star and sex symbol Ryan Reynolds Dojo toolkit lead developer Alex Russell

Alex is the lead developer for the Dojo toolkit. He talks really fast on stage! He is full of energy and seemed eager to share his insights with the audience, even though some of those insights paint a rather depressing picture of the state of the web. Personally, I lapped it up. I think it was the best presentation of the conference. Rather than talking just about Dojo, he discussed among other things:

  • the complexity of web development, and why there is a need for JavaScript libraries/frameworks in the first place
  • the burden of bringing new semantics to the web
  • how the lack of progress and competition is putting the whole open web in jeopardy

You can get the slides for the presentation on Alex’s blog, but without his lively and passionate narrative, they lose a lot of their power. Although he also talked about the technical capabilities of Dojo itself (powerful internationalization features, accessibility already built in to all its widgets, all built on top of a tiny core), it’s the strategic positioning of the toolkit that is going to make me download it and try it out.

“JavaScript: The Good Parts” by Douglas Crockford

Douglas CrockfordDouglas Crockford is one of the people most responsible for bringing JavaScript to its current level of maturity. He invented JSON, and wrote the JSLint checker and JSMin minifier. He reckons that JavaScript is the world’s most misunderstood programming language. His presentation covered some of the best bits, which you probably would not discover on a first glance at the language, such as Lambda expressions, closures, and dynamic objects.

Douglas stands in the opposite camp to Brendan Eich when it comes to evolving JavaScript. He wants to see the language become more secure (very important, given how glaringly insecure it is right now), but he thinks that the radical changes proposed for JS2 are wrong. One of the best parts of JavaScript is its stability: there have been no new design errors in the language since 1999, because that’s how long JS1 has been frozen. (There have been minor iterations to it since then, but nothing on the scale of the fundamental architectural changes that JS2 will bring.) He is still keen on evolving the language, but in a much more gradual way.

One very interesting thing that Douglas briefly mentioned was ADSafe. This is a subset of Javascript, designed for safety: a script built with the ADSafe subset can still perform useful work (it still has access to the DOM, and can make network calls), but it is not allowed to use any of the features that make JavaScript inherently unsafe (e.g. access to global variables, use of eval, etc.). ADSafe is a static checker: you run it to verify the code before you allow the code to appear on a page. If it isn’t safe, you don’t let it run. Google’s Caja works in a different way: it takes untrusted code and transforms it into safe code. To understand the use of these tools, consider Google’s iGoogle home page, where you can have widgets from a variety of sources all running on the same page. Without some kind of safety container, these scripts would have access to each other’s code and capabilities — very dangerous.

(The slides Douglas has on his blog are not quite those he used for this presentation, but they’re close enough.)

Wrap-up panel discussion with Brendan Eich, Stuart Langridge, Alex Russell, Douglas Crockford, and moderated by Jeremy Keith

Brendan EichStuart LangridgeAlex RussellDouglas CrockfordJeremy Keith Jeremy tried to keep this light-hearted, but there was clearly some tension between the panellists. I was pretty tired by this point, though, and the thing I remember most is Alex berating Yahoo! (Douglas) for not open-sourcing the YUI framework and coming together with other toolkit developers to present a unified front to browser vendors. Other subjects that came up included Google Gears (again), how badly CSS sucks (I see their point, but I still like it anyway), and capability-based security (see also The Confused Deputy).

(Jeremy’s has write-ups day 1 and day 2 on the DOM Scripting blog.)

Overall

It was a very interesting conference. It didn’t feature as much technical content as I had expected: it was more strategic than tactical. I didn’t mind at all, though, that it wasn’t just about “Ajax”. I love JavaScript, and I came away feeling excited by the amount of activity in the field.

The most important things I took on board:

  • Make more use of the build process
  • Investigate Google Gears – there is a lot of interesting stuff going on there, and it will start making its way into browser implementations soon
  • If you’re doing any kind of JavaScript development beyond simple form validation, you really should be using a library…
  • …probably jQuery…
  • …but Dojo looks REALLY interesting

THE THREE

About four and a half years ago–on the plane to Boston for our 2003 Toad The Wet Sprocket Road Trip, to be precise–my brother Scott asked me a question:

“If you were going to be stranded on an island for the rest of your life, and you could only bring three songs with you, what would they be?”

The question is similar to the classic Desert Island Discs poser, but limited to three songs instead of eight “pieces of music”. Does this make the decision any more difficult? I’m not sure, because I had never considered the question before then, and in the FOUR AND A HALF YEARS since then, my brain has not been able to get past figuring out what those three songs would be. Seriously, I don’t think a month as gone by without me lining up a couple of tentative “THREE” playlists to see how they felt.

At work, I have a reputation for being a “completionist.” I have no idea why.

I have had so much trouble finding the (or at least, “a”) right answer because I live on a diet of new music. I have bought or downloaded 67 CDs so far this year (yay for eMusic). I don’t consider myself a “muso”, but I love variety, and I love falling in love with new sounds and new bands. Being limited to just three tracks for the rest of my life would be a kind of Hell. (Worse than being stuck with nothing but Dutch radio, even.)

So the three tracks have to be really spectacular — songs that I never grow tired of, no matter how often I hear them. Songs that consistently bring a smile to my face, get my blood moving, make me tap my feet and bash the air drums. Tracks with bite, texture, and enough complexity that I still find new things in them even after hundreds of listens. Songs that in thirty years’ time I won’t be cursing my younger self for selecting.

It’s this long-lasting criterion that has made it difficult for me to trust the staying power of recent songs. In fact, the first two tracks I have finally chosen are both from 1971: they’re older than me. I have never known a world without these two tracks in it, and they still sound great. Earlier this year I decided that they were definitely part of THE THREE.

The third track worries me because it’s from 2004 — only three years old. But I really have listened to it over and over again since it was released, and it never sounds anything less than awesome. After all this time dithering over the perfect track list, do I dare commit myself to a lifetime of it? I think I’m finally ready to say yes.

THE THREE

  1. Isaac Hayes – Theme From Shaft
  2. The Who – Won’t Get Fooled Again
  3. Ash – Orpheus

Do I really need to comment on numbers 1 and 2? They’re timeless classics. There is no better funk groove than Shaft, and there has never been a better rock scream than Roger Daltrey’s. But does Ash really stand up there with these greats? I think so.

The sheer energy and joy that pours out of every moment in Orpheus is energizing and infectious. Rick’s drumming is driving and furious, Tim’s yells of “go” and “yeah” launch the second half of the bridge like a starter’s pistol, and Charlotte’s cascading “ooh-ooh-aah-aah” backing vocals give me shivers every time. Crashing guitars, memorable melodic hooks, and possibly best of all for the Desert Island scenario: a sense of escape and freedom.

This is the song that would keep up my hopes of some day getting away.

The smell of a melting hard drive…

…is not pleasant.

Fortunately it was a spare external drive that wasn’t in active use. (I think. But I can’t check what was on it any more, can I?) But I’m getting really tired of disk failures now. Off-site on-line back-up is not a luxury, folks. Do it now. There are plenty of options. Mozy is pretty good, simple to use, and not expensive.

Something old, something new

We bought a car on Friday. (In fact, we bought it two weeks ago, but the infuriatingly slow Dutch bureaucracy meant that we couldn’t actually take possession of it until yesterday.)

Vauxhall Astra, circa 1989Despite having driven many other cars over the years, this is actually only the second car Abi and I have owned. The first one was a sky blue 1989 Vauxhall Astra (G934 PHS). We bought it for £3500 in 1995 when I got my first teaching job. We were living in Leith, but the school was in West Lothian, and it took me the best part of an hour to get out there in the morning. I only lasted three months in the job, but even though it was a drain on our finances, we kept the car for a few years after that.

That car was also the source of the sunpig moniker. Abi has a variety of hand-painted cars in her childhood, and we joked about painting a bright yellow sun on the sky-blue hood of the Astra. I have always thought that Astras of that era look like pigs when seen from the side, so even though we never followed through on the paint job, the car became the Sun Pig.

The intervening cars never acquired names, but we are starting to call this new one (a green Daewoo Matiz from 2000, for €4000) the Turtwig, or Turty for short. Turtwig, as you probably know, is one of the starter Pokémon you are offered in Pokémon Diamond and Pearl. It’s an obvious choice, as I’m sure you’ll agree they look uncannily similar.

Turty

Also on Friday, I set up my old Mac Classic on my desk. This is the first computer I bought myself, back in the summer of 1991. It saw duty until late early 1996 (still running OS 6), at which point I assembled Frankenstein, my first Windows PC. Frank has evolved (like a Pokémon) since then, and he is still my main computer. You can see Frank and the Mac side-by-side on my desk in the photo below.

Frank and the Mac

The Mac still works perfectly. Alex has been enjoying Sim City (version 1.4), and Fiona has been discovering the joys of SuperPaint. (The Fool’s Errand is still a bit beyond them, though.) The main reason I brought the Mac with me to the Netherlands was so that I could spend some time extracting all the old files if have on it, and converting them into more durable and open formats. It’s too old to have digital photos on it (it has a 9″ black and white, not even grayscale screen, and a 40MB hard disk), but it has a whole lot of text and email, most of it in Word documents and Compuserve filing cabinet archives.

Pipe Dream High ScoresBut it was the game Bioshock that provided the impetus to actually set it up this week. Why? Bioshock features a hacking mini-game that is based on Pipe Dream, which is one of the games I played most on the Mac, and I felt hugely nostalgic for it. It’s still a great game.

(Incidentally, the Mac version of Pipe Dream was coded by Eric Johnson, a friend of Abi’s. We went white-water rafting with Eric in 1992, and as I was digging through old photos this evening to see if I could find any of the original Sun Pig, I found some snapshots of that trip. Wow. I think I have a lot of negative scanning to do this winter.)

At the same time as I’ve been feeling nostalgic for old-skool Macs, so have other people: Peter Merholz posted some pictures of the original Macintosh user manual last week, and earlier today Steven Poole was reminiscing about how good version 5 of Microsoft Word was.

He is absolutely right. The ribbon interface in Office 2007 makes me weep. But every time I see it, it reminds me how little I actually use “Word documents” these days. Most of my word processing is all about the text, and for the purposes of editing, preserving, and archiving text, MS Word is more than just overkill, it’s actively counter-productive.

I may have been PC-based for the last decade, but I’m returning to my Mac roots. The Mac Mini was just a taster. My new work laptop is a MacBook Pro, and my eye is on one of those new 24″ iMacs once Leopard drops.

Everything old is new again.

The Rules of Stuff

I have spent a lot of time recently compressing and optimizing my life: files, books, ornaments, mementoes, and random clutter. Moving house was a convenient opportunity to cut down on the proliferation of sheer stuff. In doing so, I have learned an important lesson: there are four distinct types of stuff:

  1. Stuff you still need. Easy to deal with: keep it.
  2. Stuff you don’t need any more, and to which you are not emotionally attached. Also easy: toss it.
  3. Stuff you don’t need any more, but you are emotionally attached to. This takes longer to deal with, because you spend time reminiscing about it. But you should keep it.
  4. Stuff you don’t need any more, but have kept around because you think you have an emotional connection to it, or even worse: you think you should have an emotional connection to it.

It’s the Type 4 Stuff that takes up all the time. Maybe it’s a collection of oddly-shaped seashells, stuck in a box in the back of your desk. You collected the shells as a kid, and have never thrown them out because, well, you’ve always had them around, and they’re a connection to your childhood. But do you really remember the beach where you collected them, and does seeing the shells remind you of that holiday?

Maybe it’s a stash of crystal wine glasses tucked away in a corner of your kitchen and never used. You haven’t thrown them out before because, well, they were wedding presents. But do you still remember who gave them to you?

Do you really intend to re-read those old class notes from college? Will you ever look over all those old birthday cards again? Worst of all is your kids’ early artwork. If it’s the first recognizable stick figure your child drew, that’s significant. But what about all the other random swirls and hand-prints? How certain are you that they were made by your child, and that the nursery didn’t accidentally give you another kid’s paintings?

It’s an agonizing and painstaking process, but if you don’t want to end up drowning in a sea of random clutter, every now and then you have to be ruthless and say: what does this item really mean to me?

If the answer is “nothing”, that’s a strong argument for throwing it out.