The state of HTML

HTML is the core technology of the web. Yet, it has changed very little in recent years. Is HTML complete? Is it neglected? What is the state of HTML?

What is the state of HTML?

Here are my takes…

How is HTML used?

Moira Rose from the TV show Schitts Creek saying the words 'Fold it in'
How to make a webpage, a summary: Take the HTML and fold it into the JavaScript

The medium

Building user interfaces

Evolution of HTML

Handling data that is bound to HTML

Education

I don’t have much insight on how well HTML is taught in general now. From what I gather, there is a tendency of teaching just enough HTML and CSS to get to building things with JavaScript. It is often left up to the student to cover things in more depth. It does appear some courses put more emphasis on accessibility now, which is a step forward.

Perception of HTML

A star wars-eque jump to another galaxy with the words: really, fast, text
Join us on the interweb - Hypertext is like jumping to another galaxy

Defining moments

When you look back to try to understand where we are, it is hard to extrapolate the reasons why this or that happened. I would say that probably the inability to build to a webpage composed from multiple HTML files was the biggest spur for change. It is not practical to duplicate common fragments such as the website navigation across many HTML files. In the early days, people had some sort of HTML concatenation happening on a server or in a build step. There was technologies like Common Gateway Interface that enabled running scripts. Microsoft developed their server-side language Active Server Pages to be able to write dynamic webpages (gasp). None of it was particularly pretty initially. It eventually led to the rise of PHP and WordPress on the web, which provided a better experience of creating HTML from data server-side.

The web platform’s proposal to resolve some of this in HTML was called HTML includes or something similar. It never happened. I guess the route was to permit building custom elements (native web components) in HTML instead. Native web components had a very rocky inception and did not offer a viable alternative to UI frameworks. You can read the article - A Criticism of Web Components - to get a background on the shortcomings. The platform was too stagnant in this area for too long and the solutions came from elsewhere.

I believe that native web components are more mature now and are a viable option. I am not speaking from experience. Dave Rupert has advocated for them, he writes about them in his article and talk titled HTML with Superpowers. Superpowers are welcome! In any case, it will take considerable time before there is a significant shift to native web components. As much as you may want to just use the platform, there are challenges to overcome.

The desire to have every type of application on the web with a desktop-like experience led to divergent architectures such as SPAs. The crux was atomic changes to a webpage and the perservation of appplication state. Perhaps a different path could have been made if HTML and related technologies were augmented to accomodate a wider range of applications with less reliance on JavaScript. At the moment, we are slimming down some of the fat clients that have become prevalent to reach a better compromise.

Reviewing survey questions from 2023 State of HTML Survey

The inaugural State of HTML survey was done recently. The arc of the survey seems to be that it is trying to ascertain what parts of HTML you know and use, and what parts are difficult to use. It is quite comprehensive, there are over 100 questions. The questions reiterated to me that there are always some tidbits about HTML that you do not know! There are some things that I don’t use, and some things that I may never use!

Some things I never heard of:

Some things I heard of but have not used:

New things I heard of:

Regular pain points:

HTML-y things that I haven’t really used but would like to use more at some point in time:

Conclusion

Web development is weird. Once all you had was HTML. It was everything on the web. Now, HTML has become more of an final, output format like PDF rather than something you write a webpage in! It is like a garnish on a dish, the most visible bit on top that you consider last and regard least! Yet, still a webpage is nothing without HTML. It is a bit of paradox.

I think there are improvements that can be made to HTML that will make the web better. HTML is not complete! The first port of call for me would be to improve the experience making user interfaces with HTML. Make UI controls (select et al) easier to style and add behaviour to. The Open UI group are advocating for adopting an industry standard definition of UI on the web. Let’s listen to them. There is some movement on this front with the experimental selectmenu element in Chrome. Let’s crank that up!

I would like to see HTML evolve further. A paradigm to offer a partial update to a webpage is needed. There should be a HTML-y way to do the islands and hydration stuff that is sweeping through JavaScript. The HTMX library offers an example of what this could look like using attributes and leveraging existing protocols such as HTTP and websockets.

I will be interested to see the results of the State of HTML 2023 survey.

Tagged