Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Monday, May 28, 2007

An exercise in reading HTML specifications

Did you know that web pages are chunked? Imagine the page is like a big piece of paper. When you ask for the piece of paper, the server rips it up into little pieces and hands it out to people. The pieces are passed to random people until you collect all the pieces. Then you have to get some glue and stick it all together before you can read it.

Internet, that is just idiotic. You are wasting everyone's time with all this ripping up and sticking together. Time that could be spent communicating thoughtful ideas over some massive global network.

BUT THERE'S A SOLUTION. You make your webpage so small, that it only needs to take up one piece of paper. It's so small that noone will bother to rip it up, so when it reaches your audience, they don't need to glue everything back together. Imagine all the energy we'd save that way.

So here are some templates for you to build from:

html4-tiny.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

xhtml-tiny.html:

<!DOCTYPE html 
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

html5-tiny.html: (as according to the HTML5 specification on 2007-05-28)

<!doctype html>

The truth is, I don't know if these could be smaller or are even valid. First of all, the HTML validator fails me because it's a pretty generic validator. You see, the W3C provides DTDs for HTML 4.01 and XHTML 1.0 but DTDs alone cannot verify 100% conformance to the spec. This means that things are special-cased and I'm doubtful they've special-cased some idiot wanting to write the smallest possible HTML document.

The HTML5 spec is easier to read because it is designed with audience in mind. But at the end of the day, it's still a spec. Spec aren't meant to be read by humans. They're meant to be read by pedantic assholes (who yell at people trying to interpret the spec) and angelic humanitarians (who interpret specs and translate for the rest of us).