The Web has succeeded at interoperability and scale in a way that no other technology has before or since. Still, the Web remains far from “state of the art”, and it is being increasingly threatened by walled gardens. The Web platform often lags competitors in delivering new system and device capabilities to developers. Worse, it often hobbles new capabilities behind either high- or low-level APIs, forcing painful choices (and workarounds) on developers.
Despite browser versions being released much faster, new capabilities still take a long time to materialize, and often do so in forms that are at best frustrating and at worst nearly useless to large swathes of the developer community for solving real-world needs.
Further Reading on SmashingMag: Link
- Making A Better Internet1
- HTML APIs: What They Are And How To Design A Good One2
- A Beginner’s Guide To Progressive Web Apps4
The best recent improvements to the platform have been the result of collaborative discussions between developers and browser vendors. Sometimes these lead to big new features. More often than not, they lead to small changes that make existing systems suitable for a wider range of uses. In the absence of an intellectual framework for making these changes, we get a hodgepodge approach to design, where good ideas are not carried through and discredited patterns live on far longer than they should.
Building on the successes of tight collaboration between Web developers and browser-makers, folks who have iterated on proposals and straddled both sides of the line (including this article’s authors, Yehuda Katz5, Dimitri Glazkov6, Erik Arvidsson7, Dave Herman8 and others) have taken a longer look at what gives Web features longevity and utility.
The process of introducing new features is usually an either-or proposition (i.e. either declarative features or low-level APIs) in the short run. But in the long run, nearly all features need expression in both domains. Moreover, we have to realize that proposals for new standards are hard work. The people doing that hard work are generally trying to do the right thing and can’t wait forever to ship features. A pragmatic, realistic approach to increasing the power and quality of Web APIs is needed, one that doesn’t presuppose infinite time, effort or understanding on the part of participants — just goodwill and a willingness to build bridges.
To support this goal, the standards process needs an intervention.
- Where the platform already provides high-level systems, related low-level additions should be used to explain how the high-level bits would have been written in terms of these new lower-level APIs.
- When adding new raw power to the platform, prefer lower-level to higher-level APIs because they enable experimentation and iteration ahead of broad adoption.
The core insight is that the Web has come this far on the back of largely declarative, largely high-level features: HTML elements for forms, CSS for layout and styling, and
<a> for defining relationships between documents. While each of these adds APIs, little effort has been made so far to explain how they do their work and how they relate to each other.
While you can almost sense the many strata of APIs below Web features, they go unnamed, unexplained, unconnected and unavailable to you when the system doesn’t do exactly what you need.
- The HTML5
canvaselement defines a programmatic 2-D bitmap API, while the long-standing
canvasAPI. Very strange that they’re separate elements and that the
imgelement doesn’t have the
- Asking for camera access with
<input type="file" accept="image/*;capture=camera">as well as with
getUserMedia()is possible, but the form element version isn’t explained in the HTML specification in terms of
getUserMedia()(which, admittedly, was added later — but no one has bothered to connect them yet).
- That’s better than the Geolocation API14. There’s currently no way to do that with an
inputelement. It’s a valuable feature entirely disconnected from markup.
- Neither HTML nor the Web Audio API15 explains how the
audiotag works, despite the Web Audio API clearly being capable of providing the
This isn’t to pick on or single out any of the hard-working developers and authors who have poured their lives into building consensus and software to introduce these capabilities. Indeed, we are grateful for their accomplishments.
The high-order bit is that the job isn’t done when both declarative and script-driven versions of a feature appear. Building a platform that’s resilient and adaptive for the long haul hinges on giving developers the confidence to take what they learn about one area and apply it evenly across the system. And that means explaining how the system works and drawing connections between the pieces.
The answers aren’t always obvious, but the process of asking “How does that work?” is often more fruitful than it first appears. Details come into focus and missing explanations are uncovered, layer by layer. At each layer, it’s tempting to throw up our collective hands and say “It’s too hard” to explain all the stuff down there. Throw it all out. Start over. At least we won’t make the same mistakes, right?
Perhaps. But we’d also be starting from zero. Zero users, zero developers and zero useful content. The Web is the open, extensible, multi-vendor, universal platform of our lifetime. Small, meaningful changes to the Web can have an outsized impact relative to the effort involved. It’s a straightforward way to do a great deal of good. Encouraging layering, bit by bit, doesn’t mean giving up or “slowing down.” Just the opposite: It’s our only credible hope of making a Web that’s worthy to succeed the Web we have today.
(al, ea, il)
- 1 https://www.smashingmagazine.com/2012/09/make-better-internet-story-three-acts/
- 2 https://www.smashingmagazine.com/2017/02/designing-html-apis/
- 4 https://www.smashingmagazine.com/2016/08/a-beginners-guide-to-progressive-web-apps/
- 5 https://twitter.com/wycats
- 6 https://twitter.com/dglazkov
- 7 https://twitter.com/ErikArvidsson
- 8 https://twitter.com/littlecalculist
- 9 http://www.flickr.com/photos/opensourceway/7496803526/
- 10 http://www.flickr.com/photos/opensourceway/7496803526/
- 11 http://extensiblewebmanifesto.org
- 12 http://www.flickr.com/photos/opensourceway/5537457153/
- 13 http://www.flickr.com/photos/opensourceway/5537457153/
- 14 http://www.html5rocks.com/en/tutorials/geolocation/trip_meter/
- 15 https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html
- 16 http://www.flickr.com/photos/opensourceway/5319988695/
- 17 http://www.flickr.com/photos/opensourceway/5319988695/