Github and QUnit

This year, Glow switched over to using Github as it’s code repository when it went open source to make collaboration easier. To be honest, getting used to git and github in general has been somewhat of an uphill battle for the team, but we’ve really found it’s come into it’s own recently now that we’ve adopted using submodules.

Glow 2 now includes Sizzle, Woosh and QUnit all as submodule projects of Glow, and doing so has instantly made Glow feel like a more team-playing product.

The whole many hands make light work approach is really quite good fun. For example, Jake started working up a design for Woosh, his new speed test framework for JS that he’s also open-sourced, which was making default QUnit look a bit… uh… under-loved, so I forked QUnit and started to reflect the designs, and over the last couple of weeks worked it up to something that the QUnit team have decided to accept back into the main project. Github made that extremely easy and now Glow, jQuery and the wider JS community benefits from a little bit of time spent making something that was essentially made to please just 3 pairs of eyes.

QUnit Theme, Screenshot by John Resig

Picture credits: QUnit Screenshot from John Resig’s Flickr Stream, designed by myself.

Full Frontal 2009

Last week I was lucky enough to get to attend Full Frontal 2009 in Brighton with a whole bunch of my colleagues to lend a bit of support to friend and fellow Glow developer, Jake, after his previous highly successful first foray into the world of speaking at last year’s @media ajax.

The range of topics was excellent. It was really good to see some more people speaking about server-side JavaScript and it seems that Simon Willison’s talk and demo of node.js was a particular highlight for a lot of people and certainly seemed inspiring (which is possibly why he’s always such a good last speaker).

I’m never terribly good at taking notes, but I didn’t think there was an off session of the day. PPK wowed us with the frankly impossible task that is mobile browser testing, Todd Kloots did one of the better and more thorough introductions to ARIA and accessible JavaScript development talks I’ve seen (and it’s a shame he ran out of time), and Robert Nyman did a gallant job of explaining closures and currying (amongst other things, via the inexplicable medium of Ben Affleck) – both of which I think are akin to explaining string-theory to primary-schoolers.

Of course, I’m slightly biased and I really want to tell you everyone else is just being kind and he actually sucked, but even though I’d already seen Jake’s “Optimising where it hurts” practice run-throughs and had already heard many of his jokes and examples, I still laughed throughout and thoroughly enjoyed his animated way of explaining the topic (which he does fluently and coherantly) and thought he stole the day.

Generally, I thought the day was a total success. The venue was lovely (although it’s a shame it wasn’t a slight bit more central, and the rain always sucks) as it was a fully-functional cinema – seats were comfortable and the quality of the screen and sound were excellent. Everything seemed to be organised extremely well and can’t really fault it, so big congrats to Remy and his lovely wife, and all the helpers. I really hope they organise one again next year – I’ll definitely be there.

The Decemberists/Emmy the Great

Emmy the Great

Not bad. Slightly underwhelmed and the sudden demise of the set was a let-down.

The Decemberists

Something very special. The beautifully orchestrated first set complete play-through of the new album, The Hazards of Love, then a second set of eclectic favourites from the past played by the massively multi-talented group was a sensation.

The Decemberists at The Coronet, 19th November 2009

Planning Glow 2 – we want your feedback!

This is an external post I wrote for the BBC Web Developer Blog

Now we’ve got Glow 1.7 out the door, our minds are turning towards planning for version 2, our next major release which will be out in the new year. We’re planning a significant overhaul, and as the major version increment indicates this will include a fundamental rewrite of large portions of the library.

Now is also a great time for users and contributors to get involved. Please tell us what you’ve liked and disliked about version 1, and what features you’d most like to see in version 2.

We have produced a set of four themes that we’d like to explore in Glow 2. These might get you thinking about what your perfect desert island library would contain, or maybe you think we’ve missed something vital?

  • Accessibility – provide a step-change in accessible and usable widgets
  • Performance – reduce load and execution times to the bare minimum
  • Design – build widgets that look fantastic alone or in combination
  • Community – open up the project and help the community thrive

We really want to hear what you think. If you’d like to talk to us about your ideas then join us on our mailing list, chat with us on IRC or you can send @bbcglow a message on twitter or by adding the hastag #bbcglow2 – we’ll do our best to respond to everyone who sends us a suggestion.

Slow Club/The Cheek/Cate Le Bon

Cate Le Bon

Pretty cute set. Twangy plucked acoustic guitar and simple lyrics.

The Cheek

Deritive dullness. Felt like I should have been watching them reherse in their parents’ garage. If they lost a superfluous guitarist and that too-cool-for-school vocalist/keyboardist* (*if you can call someone who pushes half a dozen keys in a set one) they might be able to sort themselves out a bit.

Slow Club

See previous gushing posts. I’m totally starting to get into the obligatory sing-a-long. Last mention though before this blog becomes about them exclusively.

Slow Club at Scala, 24th September 2009

Slow Club/Viking Moses/Pete Ingo

Pete Ingo

Unfortunately, we mostly missed Pete, but we caught his last track – seemed nice enough.

Viking Moses

Weirdly animated and slightly theatrical. Really liked his Bluesy tones and sometimes childish sense of humour in the lyrics. A real character.

Slow Club

They never disappoint. Starting off by springing up suddenly in the middle of the audience with an acoustic Wild Blue Milk, and then on to mostly double-speed favourites, they were fun and charming all the way. If you haven’t seen them yet – do.

Slow Club at The ICA, 22nd June 2009

King Creosote/The Pictish Trail/Player Piano

Player Piano

Energetic but still soulful. Happy discovery. Listening to the Into The Dark EP on repeat as I write this.

The Pictish Trail

Backed up by KC on the accordian, Pictish Trail was a treat. Soft acoustic ballads mixed up with electronica keyboard samples.

King Creosote

Good mix of old and new bits, bringing in the previous acts to make up a full support band. Completely enjoyable, with only the (partly unplanned) set ending being it’s downer.

King Creosote at The 100 Club, 1st June 2009

HTML5 Microdata – Over-cooked?

What is Microdata?

Microdata is HTML5’s answer to how we should go about embedding machine-readable data in our mark-up.

At a high level, microdata consists of a group of name-value pairs. The groups are called items, and each name-value pair is a property. Items and properties are represented by regular elements.

A simple example looks something like this:


<div item>
 <p>My name is <span itemprop="name">Frances</span>.</p>
 <p>My work for the <span itemprop="company">BBC</span>.</p>
 <p>I am <span itemprop="nationality">British</span>.</p>
</div>

Where the item has 3 properties with values (name:Frances, company:BBC, nationality:British).

You can then associate item properties with items that the property is not a direct descendant of, with the subject attribute.

Essentially, you have some new attributes at your disposal:

  • item – to specify a group.
  • itemprop – to define the property of an element inside an item.
  • subject – to associate a property with a non-parent item.

You can also type items with a URL, reverse DNS labels or a pre-defined type (and each itemprop can accept multiple properties, as you’d expect with class):

Here, the item is “org.example.animals.cat”:


<section item="org.example.animal.cat">
 <h1 itemprop="org.example.name">Hedral</h1>
 <p itemprop="org.example.desc">Hedral is a male american domestic
 shorthair, with a fluffy black fur with white paws and belly.</p>
 <img itemprop="org.example.img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>

In this example the “org.example.animals.cat” item has three properties, an “org.example.name” (“Hedral”), an “org.example.desc” (“Hedral is…”), and an “org.example.img” (“hedral.jpeg”).

Quotes and examples (slightly personalised) come from the HTML5 working draft.

My reservations

My gut instinct with microdata is that it’s overcomplicating things. We have RDFa already if you really want to get into the nitty-gritty of machine-readable data and, dare I say it, microformats and good semantic practice for creating shared vocabularies for plain-old semantic HTML. I’m not sure HTML5 necessarily needs this sort of extra solution.

The last example above, with the reverse DNS typing, just looks so… heavy. Something about it just doesn’t feel right and it’s actual value to me remains unclear, or at least I can’t see the value of specifying the path on each element. Couldn’t that be inferred from the structure, or subject used where ambiguities appear, and then as a last resort specify it on each element?


<section item="org.example.animal.cat">
 <h1 itemprop="name">Hedral</h1>
 <p itemprop="desc">Hedral is a male american domestic
 shorthair, with a fluffy black fur with white paws and belly.</p>
 <img itemprop="img" src="hedral.jpeg" alt="" title="Hedral, age 18 months">
</section>

The itemprop attribute bothers me most. I can’t help but think that all the examples shown in the draft would still work if itemprop was replaced with class. The class attribute is already designed to take a semantically rich term for the element. Worse still, assuming class is used appropriately, you’ll end up with unnecessary repetition across the attributes.


<div item>
 <p>My name is <span class="name" itemprop="name">Frances</span>.</p>
...
</div>

The subject attribute examples aren’t great, which doesn’t help their case – they don’t seem that real world (although there are plenty of good reasons why you might need subject – just look at the microformat include-pattern for example, and how that would be improved with it). A few of the examples could be better represented and relationships then inferred from the element structure (and I wouldn’t mind, but HTML5 already offers a boat-load of new elements to take away much of the ambiguity that HTML4 had – but just sections and headers go a long way to tying information notionally together).

The microdata proposal seems to be about making explicit what could otherwise already be inferred from the actual elements and values (although I’ll concede that it’s often inaccurate or very difficult). Wanting to be exact isn’t a terrible idea (it works really well for the for attribute, for example) and I do like disambiguation. I just don’t think the current proposal really solves the right problems as it stands.

I do think that subject has the most legs of the new attributes, though, but surely it could be as simple as:


<div id="about">
<p>I'm Frances and I like to complain about things on the internet.</p>
</div>
...
<p subject="about">I own no cats. :(</p>

Let the subect do what for has done for label, but across all elements, tying wayward bits of information to an ID (or maybe simply use subject alone to tie pieces of information together – but then this starts to feel like a class job again).

Or an example with class in place of itemprop and using a pre-defined vocabulary:


<div id="vcard">
<p>I'm <span class="fn">Frances</span> and I like to complain about things on the internet.</p>
</div>
...
<p subject="vcard">I still own no cats. :( I do work for the <span class="company">BBC</span> though. </p>

My final concern, which actually could apply to HTML5 as a whole and is more of a general are we ready for this yet? thought, is that this is a lot for an author to consider. You look at the web as it stands now, and most of it isn’t well written. Elements are abused, misused or completely forgotten (and attributes fair worse).

HTML5 offers a raft of new elements and attributes to aid clarity in information, accessibility and flexibility. Do we really think that authors on the whole have a great track-record of implementing the specs well? These new microdata attributes make what could already be a simple lesson (use class meaningfully) into a much steeper learning curve, watering down the overall benefit.

I’m not suggesting that that should be an excuse to not make HTML5 as rich as possible, but it should always be in mind that the web is about enabling normal people to share information – it’s not just an intellectual experiment for web developers.

Microdata is in the early draft stage – so I realise things will change.

Disclaimer

It’s well known that I’m a microformats busy-body, but this has nothing to do with my distaste for microdata as the spec stands. Sure, the two things have similar aims, but microformats has always been a solution for the here-and-now. HTML5 still “supports” microformats, and when HTML5 is ready, microformats will simplify (using the time element can’t happen soon enough) and continue to do what they have always done. I like HTML5 and want it to succeed. I am in no way condoning microformats over microdata or generally comparing the two.