4 Aug 2016

AMP Is What HTML Should Have Been

Google's AMP project speeds up the web by, among other things, prohibiting HTML and CSS features that impede performance or hurt UX.

For example, images should have their width and height set so that the page doesn't re-layout when they're loaded. It's irritating when the text you're trying to read moves away, and it also causes flicker, making the web page look bad. As another example, AMP allows only CSS filters that can be GPU-accelerated.

HTML is too permissive. It supports many features that result in a poor UX. Those features should be deprecated. For example, img tags without a width and height. The spec should be updated to consider such tags invalid, and HTML validators and browsers should flag them.

Doing the optimal thing from a UX perspective should be the path of least resistance. Only then will most web sites or apps improve their UX. You can publish all the best practices guides you want, but not everyone will read or follow them, either because of schedule or because their company culture doesn't care about a great user experience. Or because the individual programmer writing the code isn't passionate about a great user experience. There's no shortage of such engineers and managers and product managers, even at some of the best tech companies.

To improve the baseline UX for all web sites, the choice that leads to the best UX should be the path of least resistance. Deprecate and flag everything that isn't.

7 comments:

  1. Let's agree to disagree: HTML, CSS and JS are a great platform for a lot of things. By deprecating and removing features that may slow down websites you also kill the option to use the technology for web applications.

    The solution is not to remove features that people shouldn't be using for text-heavy sites but to teach them. People will always find ways to make stuff slow. One of our customers just learned to reduce the size of their homepage from 28MB to ~2MB (still a lot) by applying sensible image compression.

    ReplyDelete
  2. This is rather absurd. As much as we'd all like the web to "move forward" breaking a large part of the internet, because we are building new things now, is silly, unrealistic and not at all pragmatic.

    ReplyDelete
  3. Dominik,
    If anything, my suggestions apply all the more to web apps, which try to meet a higher bar than web sites. Web apps would also want (say) img tags with a width and height set, so that things don't jump around as it loads.

    Alex,
    I didn't say that we should remove these deprecated features overnight. Have the spec consider them invalid, have HTML/CSS validation tools flag errors, have a warning logged in the web inspector, and so on. In practice, rendering engines do handle a lot of cases the spec says are errors, like mismatched tags. This would be no different.

    ReplyDelete
  4. Hi, sorry, but how do you imagine responsive web page wih fixed width and height images?

    ReplyDelete
  5. Artūrs,
    You can change the width or height of the img in response to viewport size changes. I'm saying only that an img must have a width and height, not that it can't change later.

    ReplyDelete