@media Ajax 2007

Well, @media Ajax has been an excellent conference. In fact, it was the best conference I've attended so far (OK, I haven't attended that many, but still). The main reasons for its excellence were the tight focus on one single subject, coupled to a stellar-class line-up of speakers (including humble me). I mean, at which other conference would we have had the opportunity to see Brendan Eich shoot screaming monkeys into the audience and Douglas Crockford admit that maybe (just maybe) JavaScript is slightly less misunderstood than it was a few years ago?

The venue was in the heart of Westminster, and during part of the first day Queen Elizabeth II was kind enough to provide some light entertainment by celebrating her 60th marriage anniversary in Westminster Abbey. That meant that it took me about half an hour to actually get into Dean's Yard (which is right next to the Abbey) because just about every entrance was blocked by polite yet firm police officers. In the end I found my way in, and in revenge I took the liberty of discussing a few of Her Majesty's illustrious and less illustrious ancestors and their problems on stage.

JavaScript has come a long way

On the first day, several speakers looked back to the long-gone days of @media 2005, when we had a JavaScript meet-up which led to the formation of the DOM Scripting Task Force.

JavaScript has come a long way from those days. Back then we worried about its lack of standing in the web community; a problem that has been solved thanks to the Ajax hype (the Task Force itself had little to do with this process). Nowdays JavaScript is as mainstream as it's likely to get; something that definitely wasn't the case two and a half years ago. Back then, who would have dreamed of a two-day conference exclusively devoted to JavaScript and Ajax?

Incidentally, it increasingly appears as if we don't need a separate Task Force for DOM Scripting any more. Though plenty of work still needs to be done, we don't have to convince anyone that JavaScript can be useful in web pages; something that was very much in doubt during the 2002-2005 dark age. Therefore, as far as I'm concerned the Task Force can be disbanded safely, though individual members (including myself) will continue to work on specific issues.

Anyway, it was Chris Heilmann who pointed out that of the people present at that 2005 meet-up, no less than five spoke at @media Ajax; in order of appearance Derek Featherstone, Stuart Langridge, Chris and myself on day 1, and Jeremy Keith for a bit of panel moderation at the end of day 2. (Honestly, this hadn't crossed my mind even once until Chris pointed it out.)

Presentations

The quality of the presentations was high, which is one of the most important reasons why this conference succeeded so well. Unfortunately I missed the first two sessions on Day 1 (by the Ajaxians and Mike Stenhouse) because I still had to do some last-minute work on my own presentation, and part of Brendan Eich's session on Day 2 because I overslept. Fortunately I was able to see the rest of the programme in its entirety.

One of the questions to the audience was: "Would you also have come if this conference had been called @media JavaScript?" The answer was a resounding Yes; which means the attendees didn't flock together just to play buzzword bingo; they actually wanted learn something about the world's most misunderstood programming language.

Day 1

As I said, I missed the first two presentations, so the first one I actually attended was Derek's.

Derek, as always, gave some clever accessibility advice; especially on how not to code largish map applications, as well as a bit on the upcoming role attribute and accessibility oddities of British Rail and the St. Ermine hotel most of the speakers stayed in.

Stuart's presentation on How to Break the Web was hilarious, though despite all the jokes and references to horse porn he did make a serious point: it's so bloody easy to break the Web, if we really want to. Food for thought.

To me, Chris's presentation on Ajax workflow for large teams was the highlight of Day 1, because what he said made so much sense. Basically his most important messages were:

The only problem with Stuart's and Chris's presentation was that they were slightly too short, which is why at the last moment I added a few slides about preloading to my presentation in order to fill an extra five minutes.

Ajax at Work: a Case Study

As to my own presentation, it went OK, I guess, but after my recent San Francisco experiences I have increased my expectations of myself, and I'm afraid I fell a little short.

View my slides (760K PDF).

I presented a case study; an interactive family tree application which I had filled with Plantagenet and Tudor data in honour of the occasion, even though the eventual application will contain different data. (Warning: Currently works only in Firefox and Safari.)

I could not resist the temptation to show the use of such an application has by explaining why Shakespeare never wrote Edward IV, but I'm afraid I spent too much time on it because I got carried away a bit.

Other than that, this family tree (which obviously uses Ajax to get its data from the server) allowed me to talk about a few basic but important Ajax questions; notably which data format to use to communicate with the server, and loading data snippets. I asked some questions, and several members of the audience gave sensible answers that helped me a lot. Thanks for that.

Then, fortunately, it was beer o'clock and we adjourned to the pub. After an excellent Japanese dinner with Bruce Lawson, Chris Mills, and Robert Nyman, followed by some more beers, I went to bed quite contentedly.

Day 2

As I said I missed the start of Brendan Eich's presentation, but fortunately I arrive in time to see him shoot screaming monkeys into the audience in honour of ScreamingMonkey. Then John Resig took over and showed us the elegance of jQuery's syntax. John repeatedly stopped his presentation in order to answer questions from the audience, and didn't hesitate to edit his presentation slides in plain view of the audience, something I'd never dare.

John was followed by Dan Webb, who explained the JavaScript constructs that allow meta-programming; which means a program changing itself at run-time. His (to me) most useful example was the following:

function addEvent(obj,evt,fn) {
	if (document.addEventListener) {
		addEvent = function (obj,evt,fn) {
			obj.addEventListener(evt,fn,false);
		}
	}
	else if (document.attachEvent) {
		addEvent = function (obj,evt,fn) {
			obj.attachEvent('on'+evt,fn);
		}
	}
	addEvent(obj,evt,fn);
}

Basically, what happens is that the first time addEvent is called, the function determines whether the browser supports addEventListener or attachEvent. It then rewrites itself to a new function that uses the detected method to add the event. As a result, we only have to do the object detection once, which is much more elegant than doing it every time.

Although in I kind of realised this could be done, Dan brought the point home forcefully, and I'm going to rewrite my standard event scripts.

Then came my personal favourite on Day 2: Alex Russell's presentation. Originally it was supposed to be about Dojo, but Alex (who is, incidentally, one of the very few people to agree with my stance on the use of custom attributes) took a rather larger view of things and went into a description of the more social factors of web development; especially stressing that we should stop our in-fighting, and that JavaScripters should combine to force browser vendors into upgrading their JS support where necessary; as CSS developers have already done succesfully.

The last presentation was Douglas Crockford's, who separated the good from the bad in JavaScript Core. I sort of understood most of what he said, but I need some time to study his code examples. Fortunately it seems he's writing a book on exactly this subject; I can't wait until I get my hands on it. In any case, he once more stressed that some parts of JavaScript that are generally frowned upon by "real" programmers (most notably loose data typing and functions being values) are excellent ideas. I already knew they were, but having someone of Douglas's stature confirm my opinion is always good.

Finally, Jeremy moderated the traditional end-of-conference panel, where a lot was said about JavaScript libraries and the current state of affairs in JavaScript. Jeremy quite rightly remarked that there was a Microsoft-shaped hole in this conference; when people said that "certain" browsers should mend their JavaScript support, they were not talking about Firefox, Safari, or Opera.

Then came even more beer, dinner, conversations, which eventually stretched to 1:30 in the night. All in all that was an excellent end to an excellent conference, which I devoutly hope will be repeated next year.

This is the blog of Peter-Paul Koch, web developer, consultant, and trainer. You can also follow him on Twitter or Mastodon.
Atom RSS

If you like this blog, why not donate a little bit of money to help me pay my bills?

Categories:

Comments

Comments are closed.

1 Posted by Robert Nyman on 21 November 2007 | Permalink

It was great finally meeting you! I agree that it was a superb conference just because of its heavy focus on just one part of web development, which allowed us to delve much deeper into it.

I agree about Dan Webb's example: as soon as I saw it I thought it was genius, and didn't understand why I hadn't already thought of it. So basic, but yet still so good.

And you getting carried away, as you put it, was purely entertaining, and I was happy to see you "outing" your history interest so much. :-)

And, oh, I owe you a beer. We'll take it on the next JavaScript-dedicated conference... :-)

2 Posted by billyboylindien on 22 November 2007 | Permalink

Lot of interrestings links and slideshow.
Verry useful for person like me who cannot go on this conference.

Thanks

3 Posted by Jan on 22 November 2007 | Permalink

I am afraid there is a small bug in Dan Webbs code example. If you use a web browser that does'nt support the addEventListener- or attachEvent method, you will create an endless loop.

4 Posted by Dan Webb on 22 November 2007 | Permalink

@Jan: good point! It's a pretty contrived example of self-optimising functions though. I was going for simple more than foolproof but I should have spotted that one.

5 Posted by ppk on 23 November 2007 | Permalink

Yes, I noticed that error during the presentation, but while I wrote this entry I couldn't remember which error I spotted.

Anyway, Dan (and I) wanted to illustrate a concept, not write the perfect addEvent function.

6 Posted by Ion Morega on 25 November 2007 | Permalink

Good talk at the conference, you raised some interesting questions about Ajax, and the history part was fun.

I've been using self-modifying code a few times without even realising it :) Once you start to write things like:

var f = function() { /* something */ }

changing the value of "f" is just natural :)

7 Posted by Jakob Kruse on 25 November 2007 | Permalink

It was a great conference indeed, set in great surroundings were it not for the endless rain of London.

I rather appreciated seeing you in-person, and your presentation, although mostly non-Ajax related, was entertaining and a fitting end to the day 1 talks.

8 Posted by Jan on 29 November 2007 | Permalink

@4 Dan, sure it is a great example of automatic rewriting code, and in this example the small bug isn't important at all.

I like this style of self-optimizing functions and I am starting to use it actually right now. Thank for the great idea!

9 Posted by Tanny O'Haley on 6 December 2007 | Permalink

I think that your very nice createXMLHTTPObject() function could use this optimization as well. I'm going to go to work on my scripts as well.

10 Posted by Jacob Andresen on 6 December 2007 | Permalink

I really enjoyed your talk at @media AJAX 2007 - I got a more practical approach to AJAX after listening to your talk - and I also enjoyed the history part of it :)