@media impressions - part 1

Well, I'm back from @media, and it was as wonderful as last year. I met lots of interesting people, talked about lots of geeky stuff, drank the amount of beer required by British law, and went on stage at a web conference for the first time—but I hope not for the last.

Contrary to last year I made only one single note (mentioned below). Therefore the report that follows mainly comes from my memory; and I'll probably forget to mention a few things. If you want a more complete overview, see Muffin Research Labs Archive for June 2006, where you'll find transcripts of many sessions.

There are plenty of photos up at Flickr, but I agree with Eric that people shouldn't tag their touristy photos with "atmedia". There was this bell tower close to the conference centre that's quite charming in a 19th century Gothic sort of way, and I can imagine people wanting to share this remarkable discovery online, but a photo of it doesn't count as an @media impression. Please remove the "atmedia" tag.

JavaScript libraries

My personal highlight was of course the "JavaScript Libraries: Friend or Foe?" panel I did with Cameron Adams, Stuart Langridge, Dan Webb, and Simon Willison.

It was the first time I was on stage during a Web conference, and the first time I had to do a major talk in English. Although I was quite nervous at first, doing a panel at a conference turns out to be a piece of cake. You just meet up with those chaps to discuss the geeky stuff you wanted to discuss anyway, and the audience will love it.

I was too busy talking and listening to keep close track of the exact flow of the conversation, but fortunately Paul Hammond has published a transcript of the session. (BTW: Paul also made one of those rare photos of me where I don't look like a complete dork but only a little dorkish; see also this photo by Ian Lloyd where Cameron stole my hair.)

During the panel I mainly continued on the line of thought I first discussed in my July 2003 Keep JavaScript simple column (although without the harshness). There really have been some advances in JavaScript libraries, but I basically haven't paid attention to anything that happened between the end of January and @media; I was too busy writing the book. Besides, any panel needs a bit of polarisation to keep it interesting, and my role was kind of clear from the outset: attack libraries as mercilessly as possible within the boundaries of good sense and taste.

Of course, the next day Dean Edwards proved me all wrong. I asked his advice on a problem I've been thinking about for a while now (and this was the occasion for the single note I took during the conference). Suppose I have this nice object literal that defines a few functions to create a slider:

var Slider = {
	init: function () {
		// initialize slider
	slide: function () {
		// slide slider
	// etc

My question to Dean was: how do I tell a DOM node "you're a slider now", ie. how do I make sure all the methods in the object become methods of a DOM node? His reply was that I should take his Base library and use the extend() method. That's pretty cool, and it shows JavaScript libraries can help you even if you don't believe in them.

I'd like to repeat one point I made during the panel: There are plenty of libraries that make JavaScript behave like Java, Python, Ruby, or whatever other language. On the other hand, there are few libraries that treat JavaScript as JavaScript. Sometimes I have the feeling that "hard" programmers still look down on JavaScript, are unwilling to learn it, and therefore use a library that makes it behave like their favourite language. In the long run that's not the way to go.

I have more things to say about @media, but that will have to wait for tomorrow.

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?



Comments are closed.

1 Posted by Dean Edwards on 20 June 2006 | Permalink

Yep. To make a slider you would do something like this:

var Slider = Base.extend({
// slider code

You have to code the slider interface correctly of course. ;-)

2 Posted by Seth Thomas Rasmussen on 21 June 2006 | Permalink

"There are plenty of libraries that make JavaScript behave like Java, Python, Ruby, or whatever other language. [...] In the long run that's not the way to go."


3 Posted by Justin Makeig on 21 June 2006 | Permalink

@Dean I'm fasciated by your intimation at the ability to extend DOM objects with custom mix-ins. However, I don't understand your example above. Slider is a custom class that prsumably tells how a custom slider widget should behave. What does the code, Slider(document.getElementById("slider")), do though?

4 Posted by Russ Weakley on 21 June 2006 | Permalink

This discussion on restricting or controlling tags is an interesting one.

Tags, by their very natures, are personal and infinitely flexible. They are added by people who look at the worlds from their own perspective.

For some people, the atmedia tag should only be added to the specific event - the presentations. There would be others that see the relevance of adding atmedia tags to related parties, lunches, dinners etc. And there are going to be some who add atmedia tags to photos that cover the entire experience, from getting on a plane to arriving home again.

The interesting thing here is that every application is correct for that person - even though it may seem slightly or totally incorrect to others. It is impossible to dictate tags to communities as they are made up of individuals with individual perspective.

More importantly, the restriction of tags should not happen as it takes away one of their greatest assets - that they can grow and change over time. Like modern languages, tags are alive!

I had a rave about tagging at Webstock recently:

5 Posted by Dean Edwards on 22 June 2006 | Permalink

@Justin - all Base classes can also be used to cast objects. So when I call Slider(x), object x is given the Slider interface.

6 Posted by Justin Makeig on 22 June 2006 | Permalink

Is this what you're talking about?

var Slider = Base.extend({
asdf: function() {
var slider = document.getElementById("slider");

The above gives an error in FF that slider.asdf is not a function. I'm apparently missing something. Any help would be much appreciated.

7 Posted by Dean Edwards on 23 June 2006 | Permalink

@Justin - you have to include my Base class for this to work:


8 Posted by Justin Makeig on 23 June 2006 | Permalink

@Dean, thanks for your continued help. I've posted an example page with the above code at http://makeig.com/dev/base/

9 Posted by Dean Edwards on 24 June 2006 | Permalink

@Justin - I haven't released the version of Base that allows this yet. Sorry for any confusion.