HTML5 is more than cool

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 without 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!

16 Comments

  • Ian Devlin says:

    The grouping together of everything under the sun into the HTML5 umbrella is an irritation to say the least.

    Plus people constantly saying that the Geolocation API is part of HTML5 when it’s not. I know that people, myself included, talk about Geolocation in the same breathe as HTML5, but I always make sure I explain that it’s separate from HTML5.

    Just a bugbear of mine!

  • Danny Moules says:

    CSS3 has been marketed (by the W3C no less) as HTML5’s ‘Styling’. The whole marketing exercise has been successful in encouraging uptake/hype – but uptake/hype is not everything (and its the curse of marketing departments that they think it is). The irony being of course that whilst HTML5 brings clearer and more defined semantics to web pages, HTML5’s marketing has brought murkier and less defined semantics about HTML5 to web developers.

  • I fully agree with a lot you are saying here. Just a side note on needing JavaScript over doing stuff in HTML markup – Mozilla seems to be encouraging people to not do markup but build everything in JavaScript only when I look at effort for e.g. using JetPack over XUL add-ons…

  • Devon Young says:

    “For some reason with HTML5, a lot of people seem to have forgotten the vital lesson we’ve learned the last 10+ years”

    …I think that’s just the people who weren’t doin’ this 10 years ago, who haven’t learned the history, are repeating the mistakes and lessons we went through when it was all new.

    Great article.

  • Robert Nyman says:

    Ian,

    Interesting. Personally, I don’t care that much about geolocation being HTML5 or not, but I usually stress that it isn’t when I talk about HTML5.

    Danny,

    Yes, it’s a bit ironic. Sure, CSS is used for styling, but it’s not part of nor exclusive for HTML5.

    Robert,

    Thanks! I think it’s a different context with JetPack, but yes, I’d like to have HTML, CSS and JavaScript packages there too – separation of those is good and helpful, I think.

    Devon,

    Thank you! Yes, I think it mostly applies to new people in this specific field, but it’s important that we help and educate them about the pros and cons.

  • 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

    Thank you for writing this. I was in a heated discussion with the back-end coders at work the other day because they’re creeping more and more into my side of things (JS mostly) and they seem to have no respect for all things progressive enhancement, accessibility and semantics.

    I’ve pointed some of them to this article 🙂

  • Robert Nyman says:

    Andreas,

    Hope this helps then. 🙂

  • Nick Johnson says:

    Thanks for the balanced advice. What is the process for X browser submitting a feature for standard review? What I don’t want standards to do is stifle innovation.

  • Robert Nyman says:

    Nick,

    I’d say it depends a lot, and when someone come up with something good they bring it to the table. However it’s coming from so many other places than just web browser vendors – anyone with a good idea should take part of the work by WHAT-WG and add their ideas and thoughts.

    I hope standards won’t be stifling things, but rather ensuring that features that get implemented will work the same across the board.

  • Tedel says:

    You seem to having copied this from my mind, amigo. I see websites so increasingly complicated everyday, that I’ve even stop using web-based emails at all because I don’t want to deal with them ( I just switched them all to POP3 download and period).

    I just think it is a matter of common sense: People may like the cluttered look of some websites the first time they visit them because they may find them professional; yet sites following philosophies of “the simpler the better” are the ones which best stand the test of time.

  • Robert Nyman says:

    Tedel,

    Yes, it’s kind of a side-track, but I agree on that too many web sites try to do too many things, ending up in just an overload of features.

  • Jamie says:

    “most web sites could be built on top of HTML with a progressive enhancement approach”

    Could be built – sure. But leaving ajax on the table means that your web site is going to be clunky for everyone, not just those who can’t use javascript. There’s no ‘progressive enhancement’ for things like drag & drop, and any kind of dynamic display of information, just for starters. Any UI that’s not extremely basic would need to have an alternate version.

    In 2011 there are few reasons to invest the amount of effort that is needed to make a project of any substance work without javascript… and most people don’t want to spend their money on a web site that’s designed to the least common denominator. I think it’s time to let the dream of 100% backward compatibility die.

  • Robert Nyman says:

    Jamie,

    I think it’s that stance that can be a bit dangerous. It’s not about being backwards compatible, it’s about building things from ground up with HTML and then make it richer, if/when JavaScript and certain APIs are available.

    Agreed that there are no proper way for things like drag and drop, but out of the web sites/apps I see, the majority of them could’ve have been built with HTML and then enhanced on top of that.

  • Niklas says:

    Never just take JavaScript for granted, at least not with a proper fallback.
    Do you mean “without a proper fallback.” ?

  • Robert Nyman says:

    Nikklas,

    Absolutely. Thanks!

  • […] HTML5 is more than cool. Wpis o "?wietlanej przysz?o?ci" HTML5. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.