Opera's Evangelist On HTML5 And The Future Of Browsing

Bruce Lawson, software evangelist for browser developer Opera and HTML5 expert, recently visited Australia for a series of workshops on HTML5. Lifehacker chatted with him about the move towards HTML5 and what's happening in the world of browser standards.

Lifehacker: What's the overall level of enthusiasm for HTML5 out there at the moment?

Bruce Lawson: I'd say that initially there's been a lot of scepticism. I was talking to some guys in Melbourne who were blind and who were worried it was going to bugger up all their access technologies. Hopefully I managed to persuade them that it was potentially going to make things a lot better. It's fair to say that HTML5 hasn't been welcomed with open arms by everybody though, particularly some of those who have a heavy mental investment in XHTML and the XML world. It's a big perspective shift and in their minds, it's a retrograde step.

The history is important. In 1998, the W3C said HTML was essentially finished and released it as HTML 4.0. Then they said we were all going to go to XML. It was very useful to be able to conflate the idea of XHTML with its stricter syntax rules with teaching people about web semantics and separating the content and the presentation. The trouble is that the W3C then went and dreamed up XHTML 2.0, which tore up the previous ways of doing things that had appeared because browser vendors had implemented their own stuff. It was a spec of fabulous internal clarity and purity, but the trouble is it didn't bear any relation what people wanted to do.

At that time, applications were key. Document editing apps that mimic apps on the desktop were big, but XHTML 2.0 was a document structure spec. So a group of people — including Opera and Mozilla and Apple — went to the W3C and said "We need something that allows us to write web apps in a robust and standard way, rather than as a series of voodoo hacks". It's not because HTML was crap, but because HTML had been written for documents and the world was moving on.

But the W3C said "nah mate", so a guerrilla mailing list was set up to work on a spec, then the W3C woke up and realised they needed to continue working on HTML, and used that web apps spec as the basis for HTML5. So there are people who had heavily invested in XHTML 2.0 and consider that HTML5 is a step back from this pure, internally consistent way of doing something. HTML5 has got lots of things in it which you can best describe as "fugly". They are fugly but they work — things like drag and drop and content editing. The guys behind HTML5 said "We may not be in a state of philosophic clarity and internal consistency, but we have stuff that already works so let's not reinvent the wheel".

I have sympathy with those who like internal consistency and philosophical purity, but I just rather think that people have voted with their feet.

LH: Could you also argue that while HTML5 is not as consistent as XHTML 2.0, it's more consistent than Flash? The two do get constantly pitched against each other.

BL: They are apples and oranges, HTML5 and Flash. I always get somebody asking me: is this the end of Flash? Obviously, no. There's so many things that HTML5 does and Flash doesn't, because Flash is not a document applications markup language, but there's loads of stuff Flash can do that HTML5 can't yet. And what I say to people is that the professional is the guy or the gal who looks at the job, looks at the client, looks at the target audience, evaluates all of that and the budget and uses the tool that is fitting for that job. Sometimes that will be HTML5, sometimes that will be Flash and that's entirely fine. Flash is very mature, particularly in its authoring tools. HTML5 is anything but. The most important thing is now we have a choice. When there's competition, I think everybody's game goes up.

Now there is a choice, what needs to happen to make developers more likely to choose HTML5?

BL: For developers, it's primarily an education thing. They need to understand what's being offered in HTML5 and its related specs. Then there's the question of browsers implementing the features. I've been at Opera two and a half years and I've seen a step change in the release cycles of all the browsers and HTML5 features are coming in.

What's useful is that HTML5 is nothing but pragmatic. Pragmatism is right at the centre. It's designed so you can do feature detection, so you can say as a developer "Does your browser support 'x' feature?" You're not sniffing and saying "Are you IE6, are you Opera 11, are you Chrome?" You're saying "Do you support this specific feature that I wish to use?" If "yes", then the Javascript finishes and hands it back to the browser, because there's native support. If not, then I'm going to lazy load in this fragment or this library which can be used to fake support in other browsers.

LH: Does that also help in making sites more mobile-friendly?

BL: It's a bit trickier on mobile, because mobile is as fragmented as desktop was a decade ago. But there's no reason to assume that the stuff we're seeing coming into the desktops isn't going to be in the mobiles tomorrow. That's the central thing: browser sniffing is always crap. Saying "Are you IE6?" is rubbish. Saying "do you support WebSockets?" is the way forward.

LH: What are the most common misconceptions around HTML5?

BL: One misconception is that it's not ready yet: the idea that HTML5 sounds great, but I'm not going to be bother to learn it because it's not ready yet. The cause of this misconception is, oddly enough, a semantic misunderstanding. Ian Hickson, the editor of the HTML5 spec, was asked when it would be finished. He said: either 2012 or 2022. The thing is, in W3C parlance a spec is not finished until there are two complete and interoperable implementations, so therefore the definition of "finished" is that you can already use it. It's not that you can't use it until it's finished; the definition of finished is that it's there completely in two separate browsers.

One thing that HTML5 does is it defines how browsers handle bad markup. We did a survey in 2008, MAMA, where we analysed 3 million randomly chosen URLs and we discovered that 96% of web sites don't have valid code. The thing is the HTML4 spec only defines what to do when you meet valid code. A trivial error like nested tags that produces different document object models (DOMs) in different browsers, and no browser is wrong because every browser is free to choose how it behaves with crap markup. The trouble is if you're writing industrial-grade Javascript and have to muck around with DOMs you can't predict, that causes sleepless nights and anguish.

HTML5 has a parsing algorithm that defines completely and absolutely with no ambiguity what you do with every permutation of bad markup. Now that web apps are big business, that matters more. It's not about does it work in browser X anymore: it's "oh that doesn't work in browser X and that's 3% of the market". In economically challenging times, you don't want to cut off that 2% of the market. The fact that HTML5 gives you absolutely predictable behaviour is really useful.

But it also means as part of "finishing" the HTML5 spec, they're writing a test suite which is probably going to be in the region of 40,000 different tests. That's gonna take a while.

The second biggest misconception is that Flash is going to die or Silverlight is going to die, as we've discussed.

The third misconception is that as a developer I need to throw away all my preconceptions because they've dumped XML and all my XHTML 1.0 pages won't work anymore. XHTML 2.0 as a spec was finally drowned in a bucket at the end of 2009 because it was clear that the interest was behind HTML5, but XHTML 1.0 is implemented in browsers, it's going to work perfectly forever more. You don't have to go and change your sites, and depending on your site you may never need to go near HTML5. If your site is just a document, there's arguably no reason for you ever to consider HTML5.

LH: What's the coolest feature of HTML5 that hasn't been given sufficient credit? Clearly there's more to it than in-browser video.

BL: It's always either video or "woah, look, I can write 8-bit first person shooter games in Canvas". People get all excited and I always think people who go "look at this game" should remember people were writing those games ten years ago in Flash. It's not a great example.

For me, the coolest thing is that parsing algorithm — the fact that every browser, once it has an HTML5 parser, will produce an interoperable DOM. That's not sexy, but for a web developer and a consumer, it means that you get the same result from the same page regardless of which browser you use. People don't just stick to just one browser anymore, and people understandably get pissed off when web sites don't work reliably across their browsers. Fixing that is a really cool thing for an engineer. Cool for my dad is the fact that he doesn't ring me up and hear me tut at him every time he gets a message to upgrade some plug-in. That's good for the end punter.

LH: Opera remains a niche choice in a crowded browser marketplace. What do you see in its future?

BL: As I said before, competition makes everything better. You don't have to wonder too hard why IE9 is a step change better than its predecessors: it's because of competition. The important thing is because people are getting the message now that you do feature detecting in browsers, and because of the promise of greater interoperability, and because standards like HTML5 are designed for interoperability, it means people can choose the browser that they like because of the features of that browser. What's good is that some people will use Firefox, some will use Opera, others will use IE. I'm all for the choice. The important thing is finally we're getting to the stage where there's a level playing field because people realise there's competition in the browser space, and professional developers are not trying to code for individual browsers. There's still a lot of that around, but those guys are increasingly looking like a stegosaurus.

Portrait by Patrick H Lauke


    I read the whole article wondering how he fitted in with Oprah's tour...
    Then scrolled back up the top to double check and finally work out it said Opera's, not Oprah's!

      And now I started to wonder if Oprah has her own HTML5 specialist.


      "he fitted in with Oprah’s tour"
      I was wondering what kind of Tour Oprah would have.

      Back to the topic, so if W3C wouldn't work on a spec for HTML, is there not some kind of voting out those in the W3C group for better communication? Overall i'm just glad IE9 is creeping up on the competition so that the other browsers don't get too ahead and lazy.;-)

Join the discussion!

Trending Stories Right Now