HTML5 is more than cool

DZone 's Guide to

HTML5 is more than cool

· Web Dev Zone ·
Free Resource

HTML5 is here to save us all: it has the cool functions, eye-dazzling features and APIs to go around. I get to see a lot of great things developed with HTML5, but I’d like to issue a word of caution as well.

Eye candy

Let’s start with all the eye candy we see being developed with HTML5 and related technologies. Truly amazing things, interactive features and really compelling games. I think that’s great that we now are seriously getting open alternatives to Flash and Silverlight, and also technologies that will work on more devices with no plug-in dependencies.

All that is fantastic, but HTML5 is so much more than that, so please regard HTML5 as not only performance-intense videos and animations that demand the latest hardware and operating system.

AJAX x 10

One of the problems I see, is the marketing around HTML5. In media, and they way companies try to market themselves, everything (as soon as it has JavaScript) is being called HTML5 nowadays: it’s AJAX hype times 10. And sure, HTML5 could be hard to define, but they way I see it, it consists of two major things:

  • HTML code, in the form of new semantics, form elements and other extensions.
  • JavaScript APIs, tons of them, to offer developers a vast toolset of accomplishing better things on the web.

For me, it’s not CSS. When it comes to APIs, some are actual HTML5 APIs and some are related APIs. So for me HTML5 is sort of more becoming an encompassing name for HTML5 and related APIs in general. And as long as it’s any of the slew of HTML5 or new related APis I can deal with it. But I’d just like people to just tone down the PR that it’s the akin to the Second Coming and that whatever code you write is HTML5.

Web browser exclusion

For some reason with HTML5, a lot of people seem to have forgotten the vital lesson we’ve learned the last 10+ years: there are tons of web browsers and devices out there, so we need to code according to standards instead of having just vendor-specific code. WebKit lead the way for some time with support for a lot of interesting things – the poor result of that, though, was that a number of developers started coding things that would only work in WebKit-based web browsers, and then started telling end users what web browser to use. That’s not what the web is about.

Therefore we somehow found ourselves back at the state of exclusion we had previously gone through, with things only working in Internet Explorer. We have to get away from that, we have to build on top of what we learned. Whatever you develop, if you use web browser-specific code – for instance, prefixes in CSS – make sure to include prefixes for the other web browsers too, and a standard one without any prefix. If some web browsers don’t already have support for that right now, it is bound to be in there very soon anyway.

Semantics and code separation

Looking at the HTML code of many of the web sites that claim to be HTML5, it’s not a pretty sight. Sure, they have an HTML5 doctype, but otherwise, semantics and accessibility seem to have been thrown out the window. There’s not much separation between content (HTML), presentation (CSS) and interaction (JavaScript) either, it’s just one big lump of code. So I’d love developers to see and acknowledge that HTML5 is so much more than tons of JavaScript; it’s a beautiful blend of HTML, CSS and JavaScript.

JavaScript dependency

Many web sites being built now are JavaScript-dependent, and it seems to especially go for mobile. While I can see that some web apps that are being built will need that to a certain degree, I’d venture to claim that most web sites could be built on top of HTML with a progressive enhancement approach. Just lists and views, and you require JavaScript? Really? And it’s not about people turning off JavaScript, it’s about proxy servers, firewall and other protection programs that could block or clear JavaScript from being run. It’s about search engines and accessibility. Never just take JavaScript for granted, at least not with a proper fallback.

I get the impression that HTML for many developers is a sort of necessary evil. A lot seem to come from another background and take a strictly engineering approach, where everything can be “fixed” with just JavaScript code, and usually with back-end code, pre-processors and other means on top of that. I don’t think that’s beneficial for the end result, and just generating code somewhere, putting it into a magic box, and then expect optimal results is a bit naive.

And building a web site is not just engineering, it’s a beautiful piece of communication, interaction and sharing.

Do good

HTML5 is great, it really is! But please respect and learn from all the lessons we’ve gone through, both from a web developer perspective, but also regarding the end user experience and different prerequisites they have when they will access your web site. Do good, and the web will be great!


From http://robertnyman.com/2011/05/26/html5-is-more-than-cool/


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}